Validation errors: BurgerAPI returns 422 with an RFC 9457 Problem Details body when validation fails. See Validation Error Handling.
Unmatched routes: Requests to paths with no matching route return 404 with an RFC 9457 application/problem+json body.
Framework errors: Throw an HTTPError subclass (ValidationError, NotFoundError, UnauthorizedError, ForbiddenError, MethodNotAllowedError) and let onError render it.
Hooks: Return a Response (e.g. 401, 403) from a hook to short-circuit the pipeline and send that error directly.
Handlers: Return Response.json({ error: "..." }, { status: 404 }) or use try/catch and return 500.
Debug: Error responses include diagnostics (stack, cause) only when debug is on: debug: true in the Burger constructor, or NODE_ENV=development when debug is unset. burger-api dev sets NODE_ENV=development for you. Every other environment never includes them. See Configuration.