Skip to content
Playground(another site)

bynk.types.rejection_at_boundary

Error BoundaryRejection appears where a value is stored or sent: a field of a type, or a boundary such as a call, a message or an agent.

A BoundaryRejection is the router's account of a request it refused before any handler ran: a malformed or oversized body, an unsupported media type, a wrong method. on rejected reads it to render the answer, and it is accepted only as that handler's parameter. It is refused as a record, sum or event field, an agent store field, a capability operation, or any other handler's parameter or result. Match on it in on rejected and keep what you need, such as the detail text, as a String.

Example

type Refusal = {
why: BoundaryRejection, // ✗ read by `on rejected`, not kept
}
type Refusal = {
detail: String, // ✓ keep what you need from it
}

In the Book

See also

  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.rejection_at_boundary shows the same from the installed toolchain, without a network.