Error handling

Turn API failures into predictable recovery paths.

Errors are part of an integration contract. Handle them by category, preserve safe diagnostics, and give users a clear recovery path.

Recovery model

Response familyTypical action
2xxContinue with validated response data.
4xxCorrect the request, credentials, or user input before retrying.
5xxRetry only when the operation is safe and use backoff.

Implementation checklist

Parse the documented error body when an endpoint provides one.

Show a human-readable message without leaking internal details.

Log safe context so support can trace the failure.

Exact status codes live with endpoints

The table is a recovery pattern, not a replacement for endpoint documentation. Check API reference for exact status codes and error response fields.

On this page