Error Response Format
All errors follow the JSON-RPC 2.0 specification:Error Object Fields
Standard JSON-RPC Error Codes
Lasso implements the complete JSON-RPC 2.0 error code specification:-32700: Parse Error
Meaning: Invalid JSON was received by the server. The request could not be parsed. Common Causes:- Malformed JSON syntax
- Invalid UTF-8 encoding
- Truncated request body
-32600: Invalid Request
Meaning: The JSON sent is not a valid Request object. Common Causes:- Missing required fields (
jsonrpc,method,id) - Invalid field types
- Batch request exceeds maximum size (default: 50)
- Invalid
jsonrpcversion (must be “2.0”)
-32601: Method Not Found
Meaning: The requested method does not exist or is not supported in the current context. Common Causes:- Method name typo
- Subscription method called over HTTP (use WebSocket)
- Blocked method (wallet, signing, filters)
- Chain-specific method not available on requested chain
When subscription methods are called over HTTP, Lasso provides the correct WebSocket URL in the
data.websocket_url field, mirroring the HTTP request path structure.-32602: Invalid Params
Meaning: Invalid method parameter(s). Common Causes:- Unsupported chain name or ID
- Missing required parameters
- Invalid parameter types or formats
- Block number out of range
-32603: Internal Error
Meaning: Internal JSON-RPC error. Typically indicates an upstream provider failure. Common Causes:- All providers failed (circuit breakers open)
- Upstream provider returned an error
- Timeout waiting for provider response
- Network connectivity issues
-32000: Server Error
Meaning: Server-side error specific to Lasso’s operation. Common Causes:- Rate limit exceeded
- Strategy access denied (profile restriction)
- Quota exceeded
- Provider override failed
- Authentication failure
Batch Request Errors
When sending batch requests, each item in the response array contains either aresult or error field:
Request:
Provider-Specific Errors
Lasso normalizes upstream provider errors into standard JSON-RPC format. Original provider errors are preserved in thedata field when available:
WebSocket Errors
WebSocket connections may receive errors in the same JSON-RPC format. Additionally, the connection may be closed with a specific close code:WebSocket Close Codes
Heartbeat Timeout
Lasso sends WebSocket pings every 30 seconds. If no pong is received within 5 seconds, the connection will be closed after 2 missed heartbeats:Error Handling Best Practices
Retry Strategy
Retryable Errors:-32603Internal Error (temporary upstream failure)-32000Rate Limit Exceeded (with exponential backoff)-32000Server Error (checkdatafor specifics)
-32700Parse Error (fix request format)-32600Invalid Request (fix request structure)-32601Method Not Found (use correct method/transport)-32602Invalid Params (fix parameters)
Exponential Backoff
For rate limit errors, implement exponential backoff usingretry_after_ms:
Circuit Breaker Awareness
When all providers fail with circuit breakers open, consider:- Switching to a different chain if available
- Implementing client-side caching for recent data
- Showing user-friendly error messages
- Monitoring circuit breaker state via observability metadata
Error Logging
Always log thedata field for debugging:
See Also
- Response Formats - Understanding successful responses
- Authentication - API key setup and usage
- Configuration - Rate limits and quotas