Errors & problem+json
DaloyJS errors are first-class. Every thrown HttpError serializes to RFC 9457 problem+json with a stable type URI, a request-id, and the appropriate Content-Type.
- 01handlerthrow new NotFoundError(...)any HttpError subclass
- 02frameworkMap to RFC 9457 fieldstype · title · status · detail
- 03productionRedact 5xx detailNODE_ENV=production strips internals
- 04wireSerialized responseapplication/problem+json + x-request-id
Built-in error classes
Throwing in a handler
Wire format
The request id is returned to the client in two places: the x-request-id response header, and (per RFC 9457 §3.1) the problem document's instance field as a urn:request:<uuid> URN. There is no top-level requestId property, clients should read the header or parse the URN from instance.
Production redaction
When NODE_ENV=production, DaloyJS strips the detail field on any 5xx response so internal stack traces and SQL fragments don't leak to clients. The full error is still emitted to your logger via the onError hook.