API Reference
Error Codes
Testnet 122606
Section
API Reference
Documentation category
Type
Guide
Technical reference
Summary
Standard JSON-RPC error codes, Ethereum-specific codes, and HTTP status reference.
Article Content
Standard JSON-RPC Errors
| Code | Message | Description |
|---|---|---|
| -32700 | Parse error | Invalid JSON received |
| -32600 | Invalid Request | JSON is not a valid Request object |
| -32601 | Method not found | The method does not exist or is unavailable |
| -32602 | Invalid params | Invalid method parameters |
| -32603 | Internal error | Internal JSON-RPC error |
Ethereum-Specific Errors
| Code | Message | Description |
|---|---|---|
| -32000 | Execution reverted | EVM transaction reverted |
| -32001 | Resource not found | Requested block or transaction not found |
| -32002 | Resource unavailable | Node is syncing or resource is locked |
| -32003 | Transaction rejected | Transaction was rejected by the node |
| -32004 | Method not supported | Method exists but is not enabled |
HTTP Status Codes
| Status | Meaning |
|---|---|
| 200 | Success (check JSON body for RPC-level errors) |
| 400 | Bad request — malformed JSON body |
| 401 | Unauthorised — missing or invalid API key |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Handling Errors in Code
const response = await fetch('https://testnet.swssrpc.swss.io', { ... })
const data = await response.json()
if (data.error) {
console.error(`RPC error ${data.error.code}: ${data.error.message}`)
return
}
// use data.result
A
200 OKHTTP response does not mean the RPC call succeeded — always check for a top-levelerrorfield in the JSON body.
