Skip to main content

Error Handling

Gale returns consistent and descriptive error responses across all endpoints to help you debug and recover gracefully.

Standard Error Format

All errors follow this format:

HTTP Status Codes

Error Examples

Validation Error (422)

Unauthorized (401)

Not Found (404)

Rate Limited (429)

Response includes Retry-After header indicating seconds to wait.

Best Practices

  • Check status code first: Use HTTP status codes to determine error type
  • Parse error details: Check error.details.field_errors for specific validation failures
  • Implement retry logic: For 429 and 500 errors, retry with exponential backoff
  • Log errors: Store error responses for debugging