Welcome to Nebutra Sailor Docs šŸŽ‰
ChangelogIntroductionLicensing
Help Center (External) ↗

Error Reference

How backends/gateway reports errors — the real envelope and error codes from @nebutra/errors.

Error envelope

The gateway's app.onError handler (backends/gateway/src/app.ts) converts every thrown error with toApiError() from @nebutra/errors:

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Human-readable description of what went wrong.",
    "details": { "suggestion": "..." }
  },
  "requestId": "req_..."
}

requestId is only present when the caller sent an x-request-id header. details is only present when the underlying AppError carried metadata or a suggestion. There is no success field — a 2xx status means success, a non-2xx status with this envelope means failure.

A 404 with no matching route (rather than a thrown NOT_FOUND error) returns a simpler shape from Hono's notFound handler: { "error": "Not Found", "path": "..." }.

Error codes

From ERROR_CODES in @nebutra/errors (packages/platform/errors/src/index.ts):

4xx — Client errors

CodeTypical status
BAD_REQUEST400
VALIDATION_ERROR400/422 (per throw site)
UNAUTHORIZED401
FORBIDDEN403
NOT_FOUND404
CONFLICT409
RATE_LIMITED429
QUOTA_EXCEEDED429

5xx — Server errors

CodeTypical status
INTERNAL_ERROR500
DATABASE_ERROR500
SERVICE_UNAVAILABLE503
EXTERNAL_SERVICE_ERROR502
TIMEOUT504

Business errors

CodeMeaning
PAYMENT_REQUIREDBilling action needed before the request can proceed
SUBSCRIPTION_EXPIREDThe tenant's subscription lapsed
FEATURE_DISABLEDThe plan doesn't include this entitlement (see checkEntitlement in @nebutra/billing)
TENANT_SUSPENDEDThe tenant is suspended

Every thrown error's actual HTTP status comes from getStatusCode(error), which reads the AppError's own statusCode — the table above is typical, not guaranteed, for a given code.

Support

Open an issue on GitHub with the requestId and the request path/method. There is no separate Nebutra support desk for a self-hosted template — you own the deployed service.

How is this guide?

Edit on GitHub

Last updated on

On this page

Error envelope
Error codes
4xx — Client errors
5xx — Server errors
Business errors
Support