Core concepts

Error handling

Interpret authentication, validation, quota and availability errors.

Check HTTP status before using response data. Error shapes differ between authentication, controllers and request validation.

{
  "success": false,
  "message": "Invalid or expired API key"
}
{
  "success": false,
  "error": "Mountain not found"
}

These are representative verified messages, not a single universal schema. The API's global error handler maps validation/runtime errors to success: false, error (the error name) and message (details). Do not require Fastify's default statusCode or code fields in the body. Global version metadata can be appended. Code against HTTP status; do not parse English error text to determine program behavior.

HTTP statusTypical meaningClient action
400Invalid/missing validated query or path valuesCorrect the request
401Missing, invalid, expired or revoked credentialsCheck key/header and credential status
403Origin/IP restriction or authorization failureCorrect restrictions; do not keep retrying
404Missing resource or unavailable optional routeCheck path/identifier and availability
429Monthly account quota or status endpoint per-IP allowanceInspect response and Retry-After when present
500Resource read failedBounded retry; report persistent errors
503Verification, quota or data service unavailableBounded backoff with jitter

Not every endpoint emits every status. Empty filtered lists and missing media associations usually return 200 with an empty array. Missing individual resources return 404 where documented.

The monthly quota 429 does not supply a Retry-After header. Repeated retries will not restore the allowance; check the panel or wait for the next UTC calendar month. The anonymous status routes do supply Retry-After for per-IP throttling.

XML feed failures use XML <error> bodies. A conditional 304 has no body. Avoid exposing keys or complete authenticated request headers in application error logs.