Error Handling | Orwel Docs
Docs

Error Handling

Understanding and handling API errors

Error Response Format

json
{
  "error": "error_code",
  "message": "Human readable message",
  "details": {}
}

HTTP Status Codes

400Bad Request

Invalid request parameters

401Unauthorized

Invalid or missing API key

404Not Found

Resource not found

429Too Many Requests

Rate limit exceeded

500Internal Server Error

Server error

Example Error Handling

javascript
try {
  const response = await fetch('/api/v1/leads');
  
  if (!response.ok) {
    const error = await response.json();
    console.error(error.message);
  }
} catch (error) {
  console.error('Network error:', error);
}