Skip to Content
CraftBot Docs v1 — internal preview
ReferenceError catalog

Error catalog

Every error CraftBot surfaces follows a consistent envelope:

{ "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Human-readable message", "details": [ ... ] } }

The error.code field is generated by the global exception filter. Two paths produce it:

  • Default — the filter derives code from the thrown exception class name in screaming snake case. BadRequestExceptionBAD_REQUEST. UnauthorizedExceptionUNAUTHORIZED. NotFoundExceptionNOT_FOUND. ForbiddenExceptionFORBIDDEN. ConflictExceptionCONFLICT. UnprocessableEntityExceptionUNPROCESSABLE_ENTITY. InternalServerErrorExceptionINTERNAL_SERVER_ERROR.
  • Override — a service that throws with a structured payload (new UnprocessableEntityException({ code: "DRAFT_CONFLICT", ... })) emits that explicit code instead. The filter also forwards any additional fields on the payload (e.g. blockers, warnings, currentDraft) so the client can render actionable feedback.

HTTP-class codes

These are the generic codes you will see most often. They map 1:1 to the corresponding NestJS exception classes.

CodeHTTP statusWhen
BAD_REQUEST400Malformed request — missing required field, unsupported content type.
UNAUTHORIZED401Missing, invalid, or expired access token.
FORBIDDEN403User has no permission for the requested action.
NOT_FOUND404Resource id doesn’t exist or is in another tenant.
CONFLICT409Concurrent update collision or duplicate resource.
UNPROCESSABLE_ENTITY422Request was well-formed but business validation failed.
THROTTLER_LIMIT_EXCEEDED429Per-client rate budget exceeded. Retry after a short delay.
INTERNAL_SERVER_ERROR500Unhandled server failure. Reported to monitoring; safe to retry idempotent calls.

Validation failures thrown by class-validator surface as BAD_REQUEST with details[] listing the failed fields. When a service throws an explicit VALIDATION_FAILED code (see below), the message indicates which field group failed.

Service-emitted codes

Services across the platform throw with explicit code overrides when the failure mode is specific enough to warrant a stable identifier. The current catalogue:

CodeWhere it originates
CREDENTIAL_IN_USECannot delete a channel credential that’s still bound to a channel config.
CREDENTIAL_MISSINGA channel config references a credential that no longer exists.
CREDENTIAL_NAME_EXISTSCredential name collides with an existing record.
DEFAULT_TRIGGER_EXISTSA recipe already owns the default trigger for its channel.
DRAFT_CONFLICTAnother author saved the recipe draft after your last load. Resolve via the conflict modal.
EXPORT_TOO_LARGEAnalytics export exceeds the size cap; narrow the date range.
FORBIDDEN_CLASS_A_REVEALAttempt to reveal a Class A PHI value without the required permission.
HEALTHCARE_CONTENT_BLOCKEDSafety pre-filter matched a healthcare-restricted phrase.
LAST_SUPER_ADMINCannot remove the last super-admin.
NOT_PUBLISHEDOperation requires a published recipe version.
RESTORE_WINDOW_EXPIREDSoft-deleted record is past its restoration window.
SELF_ACTION_FORBIDDENUser attempted to act on their own account in a forbidden way.
SOFT_DELETED_USERTarget user is soft-deleted and must be restored first.
SUPER_ADMIN_DELETE_FORBIDDENSuper-admins cannot be hard-deleted.
TEMPLATE_REQUIRES_UNRELEASED_NODESSaving the recipe as a template requires nodes that haven’t been released.
UNPUBLISH_FIRSTResource must be unpublished before this operation.
UNSUPPORTED_SCHEMA_VERSIONRecipe draft uses a schema version the API doesn’t support.
VALIDATION_FAILEDCustom business-rule validation failure. Inspect error.details for specifics.
WARNINGS_UNACKNOWLEDGEDPublish requires explicit acknowledgement of one or more warnings.

Outbound HTTP failures (API node, Smart Plug runner, agent webhook) surface their network-layer code in error.details — values include ECONNABORTED, ETIMEDOUT, EAUTH, NETWORK, TIMEOUT, UNKNOWN.

When in doubt

  • Check the audit log for an entry near the failure time.
  • The conversation timeline shows error chips next to the message that failed.
  • 5xx errors are reported to monitoring with full stack traces; 4xx errors are logged at warn level only.
Last updated on