Raising a failure: reject
reject ends the callable with a declared failure:
action reserve(product: Product, requested: Quantity) fails QuantityUnavailable -> Reservation { if (requested > product.available) { reject QuantityUnavailable { available: product.available product_id: product.id requested: requested } } ...}
The block after the failure's name gives every client and internal field at once. A failure with no fields is rejected by its name alone. A missing, unknown or repeated field is an error.
There is no reject "text" and no throw: every failure has a declared
type. reject can also be the result of a match arm
(Match).
Two things can never go in a failure's fields: a secret setting
(configuration.secret_flow, see Secrets),
and the signed-in caller
(Who is calling).
Markdown for agents: /docs/raising-a-failure-reject.md.Built from Jadpo main at a707efb.