Skip to main content

Error Handling Overview

Basic error handling pattern:

API Error Response Format

API errors return a JSON object with a single error field containing a human-readable message:
The error field contains a descriptive string. Parse the message text to determine the error type.

HTTP Status Codes

The API uses the following HTTP status codes:

Swap Creation Errors (400)

These errors are returned as 400 Bad Request when creating a swap:

Swap Lookup Errors (400)


SDK-Specific Errors

The SDK throws standard JavaScript Error objects. Match on the message property.

Initialization Errors

Swap Operation Errors

API Call Errors


Common Solutions