Error Handling Overview
Basic error handling pattern:API Error Response Format
API errors return a JSON object with a singleerror field containing a human-readable message:
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 as400 Bad Request when creating a swap:
Swap Lookup Errors (400)
SDK-Specific Errors
The SDK throws standard JavaScriptError objects. Match on the message property.