FailSafe Docs
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

CodeMeaningTypical Cause
200SuccessRequest completed
201CreatedResource created
202AcceptedMetrics ingested
400Bad RequestInvalid payload
401UnauthorizedMissing API key
404Not FoundInvalid experiment ID
500Server ErrorBackend error
503UnavailableDocker 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)
}