Skip to main content

Error Codes

All errors follow this response format:

{
"error": {
"message": "Human-readable error description",
"type": "error_type_identifier"
}
}

Error Types

TypeHTTP StatusRetryableDescription
authentication_error401NoJWT token is missing, malformed, or expired
authorization_error403NoValid token but insufficient role/permissions
rate_limit_error429YesRequest rate exceeded. Response includes retry_after_secs
validation_error400NoRequest body failed field validation (empty required field, exceeded length)
invalid_request_error400NoMalformed JSON, wrong content type, or structurally invalid request
not_found404NoRequested resource (project, branch, contributor, source) does not exist
proxy_error502YesUpstream LLM provider returned an error or is unreachable
service_unavailable503YesInternal dependency (embedding service, vector DB) is down
timeout_error504YesRequest processing exceeded the configured timeout (default: 30s)
embedding_error503YesEmbedding generation failed (service down or model error)
internal_error500YesUnexpected server error. May succeed on retry
configuration_error500NoServer misconfiguration (missing env vars, invalid settings)
database_error500YesPostgreSQL operation failed (connection, query, constraint)

Error Codes (Fine-Grained)

Within error types, specific error codes provide more detail:

CodeUsed When
AUTH_INVALID_TOKENToken is malformed or has an invalid signature
AUTH_EXPIREDToken's exp claim is in the past
AUTH_FORBIDDENToken is valid but the user lacks the required permission
VALIDATION_FAILEDRequest body validation failed
SERVICE_UNAVAILABLEA required service (embedding, vector DB) is unreachable
CONFIG_ERRORServer configuration is invalid
LOG_NOT_FOUNDThe requested resource was not found
INTERNAL_ERRORCatch-all for unexpected errors

Transient vs Permanent Errors

Transient (safe to retry with backoff):

  • rate_limit_error --- wait retry_after_secs before retrying
  • proxy_error --- upstream LLM provider may be temporarily overloaded
  • service_unavailable --- embedding service may be restarting
  • timeout_error --- request may succeed with a longer timeout or less data
  • embedding_error --- embedding model may be loading
  • database_error --- connection pool may be exhausted

Permanent (fix the request before retrying):

  • authentication_error --- get a new token
  • authorization_error --- request higher permissions
  • validation_error --- fix the request body
  • invalid_request_error --- fix the JSON structure
  • not_found --- create the resource first
  • configuration_error --- fix server configuration

Examples

Authentication Failed

{
"error": {
"message": "authentication failed: token expired",
"type": "authentication_error"
}
}

Validation Error

{
"error": {
"message": "validation error: this_contribution cannot be empty",
"type": "validation_error"
}
}

Rate Limited

{
"error": {
"message": "rate limit exceeded: try again in 60 seconds",
"type": "rate_limit_error",
"retry_after_secs": 60
}
}

Not Found

{
"error": {
"message": "not found: project 'nonexistent' does not exist",
"type": "not_found"
}
}