Skip to content

Error codes

Stable catalog codes (PREFIX-NNNN) for API and engine errors in Cadence.

Intended audience: Stakeholders, Business analysts, Solution architects, Developers, Testers

Learning outcomes by role

Stakeholders

  • Recognize error categories when reviewing incident or integration summaries.

Business analysts

  • Map API or log codes to failure classes for requirements and acceptance language.

Solution architects

  • Align client handling and observability with the platform error catalog.

Developers

  • Interpret `code` fields in JSON error bodies and match them to Python constants.

Testers

  • Assert on stable codes in API and engine tests and file defects with precise IDs.

Cadence uses stable catalog codes for errors returned by the API and raised inside the engine. The canonical list lives in src/cadence/core/exceptions/error_codes.py. API error responses include the catalog value in the JSON code field (flat body; see FlatApiError in src/cadence/schemas/responses.py). The CATALOG_CODES tuple in that module is covered by unit tests so each listed code appears exactly once.

Codes use {PREFIX}-{NNNN}: a two-letter category prefix and a zero-padded numeric id. Reserved numeric ranges are noted per category below.

PrefixCategoryTypical numeric range
SYSystem / framework9000–9999 (plus dynamic HTTP-mapped codes)
VAValidation0001–0999; misc domain uses 01xx
AUAuthentication0001–0999
AZAuthorization0001–0999
REResource / lifecycle0001–0999
RLRate limit0001–0999
OROrchestrator / engine0001–0999
PLPlugins0001–0999
LLLLM0001–0999
DBDatabase0001–0999
CFConfiguration / settings0001–0999
OAOAuth20001–0999

When the middleware maps a Starlette HTTPException to the catalog, it uses sy_http_status(status_code), producing SY-{NNNN} where NNNN is the four-digit HTTP status (for example SY-0404 for 404). These values are not part of CATALOG_CODES but are valid code values in API responses.

CodeConstantMeaning
SY-9000SY_INTERNALUnhandled internal; default for CadenceException
CodeConstantMeaning
VA-0001VA_VALIDATION_ERRORValidation error
VA-0002VA_INVALID_INPUTInvalid input
VA-0003VA_MISSING_REQUIRED_FIELDMissing required field
VA-9001VA_REQUEST_VALIDATIONFastAPI RequestValidationError (query/path/body)
VA-9002VA_PYDANTIC_BODYPydantic validation on response models / body
VA-9003VA_FIELD_VALIDATIONPer-field row in validation error list
CodeConstantMeaning
AU-0001AU_AUTHENTICATION_FAILEDAuthentication failed
AU-0002AU_INVALID_TOKENInvalid token
AU-0003AU_INVALID_GRANTInvalid grant
CodeConstantMeaning
AZ-0001AZ_AUTHORIZATION_FAILEDAuthorization failed
AZ-0002AZ_TENANT_ISOLATIONTenant isolation violation
AZ-0003AZ_ORG_MEMBERSHIP_REQUIREDOrg membership required
AZ-0004AZ_SYS_ADMIN_SELF_MODIFY_DENIEDSystem admin self-modification denied
CodeConstantMeaning
RE-0001RE_NOT_FOUNDResource not found
RE-0002RE_ALREADY_EXISTSResource already exists
RE-0003RE_CONFLICTResource conflict
RE-0004RE_QUOTA_EXCEEDEDQuota exceeded
RE-0010RE_API_KEY_NOT_FOUNDAPI key not found
CodeConstantMeaning
RL-0001RL_EXCEEDEDRate limit exceeded
CodeConstantMeaning
OR-0001OR_ERROROrchestrator / engine error
OR-0002OR_NOT_READYNot ready
OR-0003OR_TIMEOUTTimeout
OR-0004OR_UNSUPPORTED_OPERATIONUnsupported operation
OR-0005OR_PLANNER_TOOL_ROUND_LIMITPlanner tool round limit reached
OR-0006OR_GRAPH_DEFINITION_INVALIDGraph definition invalid
CodeConstantMeaning
PL-0001PL_ERRORPlugin error
PL-0002PL_NOT_FOUNDPlugin not found
PL-0003PL_VALIDATION_FAILEDPlugin validation failed
CodeConstantMeaning
LL-0001LL_ERRORLLM error
LL-0002LL_API_KEYLLM API key issue
LL-0003LL_RATE_LIMITLLM rate limit
LL-0004LL_STRUCTURED_OUTPUTStructured output error
CodeConstantMeaning
DB-0001DB_ERRORDatabase error
DB-0002DB_CONNECTIONDatabase connection error
CodeConstantMeaning
CF-0001CF_CONFIGURATIONConfiguration error
CF-0002CF_SETTINGS_NOT_FOUNDSettings not found
CF-0003CF_ENCRYPTION_INVALIDEncryption invalid
CF-0004CF_APP_CONFIG_INVALIDApp config invalid
CodeConstantMeaning
OA-0001OA_INVALID_REQUESTInvalid OAuth2 request
OA-0002OA_INVALID_CLIENTInvalid client
OA-0003OA_UNSUPPORTED_RESPONSE_TYPEUnsupported response type
OA-0004OA_INVALID_REDIRECT_URIInvalid redirect URI
OA-0005OA_INVALID_HANDOFFInvalid handoff
OA-0006OA_INVALID_REQUEST_GENERICInvalid request (generic)
OA-0007OA_UNAUTHORIZED_GRANT_TYPEUnauthorized grant type
OA-0008OA_INVALID_GRANTInvalid grant
CodeConstantMeaning
VA-0101VA_UNKNOWN_ROLEUnknown role
VA-0102VA_OAUTH_UNKNOWN_PROVIDERUnknown OAuth provider
AU-0010AU_OAUTH_PROVIDER_NOT_ENABLEDOAuth provider not enabled

When you add, remove, or rename codes in error_codes.py, update this reference in the same change so clients, operators, and tests stay aligned with the catalog.