Imported from docs/reference/error-codes.md in cloud-factory. Last synced: 2026-03-15
Error Codes Reference
Cloud Factory uses a standardized error handling system based on RFC 7807 Problem Details. All error responses are returned with Content-Type: application/problem+json.
Additional fields from the error's details object are spread into the response body.
Error Codes by Category
Validation Errors (HTTP 400)
Code
Problem Type URI
Description
Additional Fields
VALIDATION_ERROR
/problems/validation-error
Input validation failed
fieldErrors[]
INVALID_INPUT
/problems/invalid-input
General invalid input
INVALID_STATE_TRANSITION
/problems/invalid-state-transition
Cannot transition entity to target state
currentState, targetState, entityType
Validation Error with Field Details
{ "type": "https://api.t-2.cloud/problems/validation-error", "title": "Validation Error", "status": 400, "detail": "Validation failed", "fieldErrors": [ { "field": "email", "code": "isEmail", "message": "email must be a valid email address" } ]}
class-validator Errors
When NestJS class-validator pipe rejects input, errors are returned as:
{ "type": "https://api.t-2.cloud/problems/http-400", "title": "Bad Request", "status": 400, "detail": "email must be an email; firstName should not be empty", "errors": ["email must be an email", "firstName should not be empty"]}
Authentication Errors (HTTP 401)
Code
Problem Type URI
Description
AUTHENTICATION_ERROR
/problems/authentication-error
General authentication failure
INVALID_CREDENTIALS
/problems/invalid-credentials
Wrong email/password
TOKEN_EXPIRED
/problems/token-expired
JWT access/refresh token expired
INVALID_TOKEN
/problems/invalid-token
Malformed or tampered token
Authorization Errors (HTTP 403)
Code
Problem Type URI
Description
Additional Fields
AUTHORIZATION_ERROR
/problems/authorization-error
General authorization failure
INSUFFICIENT_PERMISSIONS
/problems/insufficient-permissions
Missing required permission
requiredPermission
TENANT_ACCESS_DENIED
/problems/tenant-access-denied
Cannot access another tenant's data
tenantId
RESOURCE_ACCESS_DENIED
/problems/resource-access-denied
Cannot access specific resource
resourceType, resourceId
Not Found Errors (HTTP 404)
Code
Problem Type URI
Description
Additional Fields
NOT_FOUND
/problems/not-found
Generic not found
ENTITY_NOT_FOUND
/problems/entity-not-found
Specific entity not found
entityType, entityId
Conflict Errors (HTTP 409)
Code
Problem Type URI
Description
Additional Fields
CONFLICT
/problems/conflict
Generic conflict
DUPLICATE_ENTITY
/problems/duplicate-entity
Entity with identifier already exists
entityType, identifier
CONCURRENCY_ERROR
/problems/concurrency-error
Optimistic lock version mismatch
entityType, entityId, expectedVersion
BUSINESS_RULE_VIOLATION
/problems/business-rule-violation
Domain rule prevents operation
rule
Rate Limiting Errors (HTTP 429)
Code
Problem Type URI
Description
Additional Fields
RATE_LIMIT_EXCEEDED
/problems/rate-limit-exceeded
Too many requests
retryAfterSeconds
QUOTA_EXCEEDED
/problems/quota-exceeded
Resource quota exceeded
quotaType, limit, current
Server Errors (HTTP 500/502/503)
Code
Problem Type URI
HTTP
Description
Additional Fields
INTERNAL_ERROR
/problems/internal-error
500
Unexpected server error
INTEGRATION_ERROR
/problems/integration-error
502
External system failure
system, cause
SERVICE_UNAVAILABLE
/problems/service-unavailable
503
Service temporarily down
service
Domain-Specific Errors
Code
Problem Type URI
HTTP
Description
Additional Fields
(dynamic)
/problems/order-error
400
Order processing error
orderId
(dynamic)
/problems/provisioning-error
500
Provisioning pipeline error
requestId, step
(dynamic)
/problems/billing-integration-error
502
Billing/Stripe integration error
operation
(dynamic)
/problems/notification-error
500
Notification delivery error
notificationId
(dynamic)
/problems/support-ticket-error
400
Ticket operation error
ticketId
Domain-specific errors use dynamic codes set at instantiation (e.g., ORDER_ITEM_NOT_FOUND, PROVISIONING_TIMEOUT).