Skip to main content
This example defines a typed error with data and yields it from a handler.
errors.ts
procedure.ts

Why this shape

  • the error has a stable oRPC code
  • the status is explicit
  • the data schema is typed
  • the handler can yield the error directly

Next step

See the complete Hono request context example.
Last modified on June 15, 2026