Error Handling
Errors & Troubleshooting
FailSafe returns structured errors with consistent fields across all endpoints.
Standard Error Format
Verified Error Payload
{
"error": "string (error message)",
"code": "string (error code)",
"status": "integer (HTTP status)",
"details": "string (optional)"
}Status Codes
| Code | Meaning | Typical Cause |
|---|---|---|
| 200 | Success | Request completed |
| 201 | Created | Resource created |
| 202 | Accepted | Metrics ingested |
| 400 | Bad Request | Invalid payload |
| 401 | Unauthorized | Missing API key |
| 404 | Not Found | Invalid experiment ID |
| 500 | Server Error | Backend error |
| 503 | Unavailable | Docker or dependency unavailable |
Frontend Error Handling
Common Frontend Cases
- Network failure: polling request times out or cannot reach backend
- Auth failure: API key missing or invalid
- Invalid payload: request body missing required fields
- Backend crash: 500-level error from orchestration or metrics service
try {
const response = await fetch(url, options)
if (!response.ok) {
const error = await response.json()
throw new Error(error.error)
}
return await response.json()
} catch (err) {
console.error("API Error:", err.message)
}