This section presents JSON-RPC standard error codes and custom error codes that you will encounter when using ZAN node services.
HTTP Status Codes
Status Codes
In addition to the standard Ethereum JSON-RPC error codes, ZAN will return the following status codes for HTTP requests:
Code | Description | Corresponding Error Code | Solution |
---|---|---|---|
400 | Bad Request | -32700 -32600 -32601 -32602 | Your request is invalid. Double-check your JSON-RPC body. |
401 | Unauthorized | -32000 | You must authenticate your request with an API key. If you do not have one, see Creating your API key on the ZAN platform to create one, and optionally set up a secret key for additional security. |
403 | Forbidden | -32002 -32004 -32005 -32006 -32007 | You've hit your capacity limit, or your request was rejected by your app's whitelist settings. |
429 | Too Many Requests | -32003 | You've exceeded your concurrent request capacity or Credits per second capacity, see Use limits of credits. |
500 | Internal Server Error | -32603 -32008 | We're unable to process your request right now. Get in touch with us if you see this. |
Example Response
// Example 401 Https Status Error
{
"error": {
"code": -32000,
"message": "apikey check; apikey not exist"
},
"id": 1,
"jsonrpc": "2.0"
}
Standard JSON-RPC Errors
Error Codes
Error Code | Message | Description |
---|---|---|
-32700 | Parse error | Invalid JSON |
-32600 | Invalid Request | JSON is not a valid request object |
-32601 | Method not found | Method does not exist |
-32602 | Invalid params | Invalid method parameters |
-32603 | Internal error | Internal JSON-RPC error |
Example Response
{
"error": {
"code": -32602,
"message": "too many arguments, want at most 0"
},
"id": 1,
"jsonrpc": "2.0"
}
Custom JSON-RPC Errors
Error Codes
Error Code | Message | Description |
---|---|---|
-32000 | Unauthorized | Request unauthorized |
-32001 | Resource not found | Requested resource not found |
-32002 | Whitelist limited | Whitelist limited |
-32003 | Cu limited | Cu limited per second |
-32004 | Rate limited | Service rate limited |
-32005 | Limit exceeded | Limit exceeded credit plan |
-32006 | Malicious request | Too many malicious request |
-32007 | Method limited | Method request limited |
-32008 | Invalid error | Invalid error |
Example Response
// Example 403 Https Status Error
{
"error": {
"code": -32005,
"message": "user credit plan check; credit request service not available, msg:credit consumption has reached the maximum of the package"
},
"id": 1,
"jsonrpc": "2.0"
}