Errors
There is two kind of errors that can appear when making a call on the API v2: basic JSON-RPC errors and API result errors
JSON-RPC Errors
These errors are often due to a misconstrued JSON body, for example:
there is not enough parameters:
{
"error": {
"code": -32602,
"message": "WrongNumberOfArgs. Expected 4. Actual 5"
},
"id": 1,
"jsonrpc": "2.0"
}
or invalid type of data entered:
{
"error": {
"code": -32602,
"message": "InvalidArgStructure \"start_height\" at position 1."
},
"id": 1,
"jsonrpc": "2.0"
}
or method not found:
this list of errors is not exhaustive, for more information about the possible error objects see the JSON RPC 2.0 specifications.
API Result Errors
These type of errors are due to an API error during the query. This type of error is wrapped into the result.
For example, trying to ban a peer that's already banned:
or a block that doesn't exist: