Skip to Content
BackendError Handling

Error Handling

Custom Error Classes

Error ClassHTTP Status
ValidationError400
UnauthorizedError401
NotFoundError404
ConflictError409

Error Response Shape

All errors are caught by toErrorResponse() middleware and returned as:

{ "error": { "code": "VALIDATION_ERROR", "message": "Human-readable message" } }

On the frontend, api-client.ts unwraps this into error.message, so in components just read e?.message.

Last updated on