Error
Instead of utilizing HTTP status codes to describe node errors (which often do not have a good analog), rich errors are returned using this object. Both the code and message fields can be individually used to correctly identify an error. Implementations MUST use unique values for both fields.
Properties
Name | Type | Description | Required |
---|---|---|---|
code | Int (>= 0) | Code is a network-specific error code. If desired, this code can be equivalent to an HTTP status code. | True |
message | String | Message is a network-specific error message. The message MUST NOT change for a given code. In particular, this means that any contextual information should be included in the details field. | True |
retriable | Boolean | An error is retriable if the same request may succeed if submitted again. | True |
details | Object | Often times it is useful to return context specific to the request that caused the error (i.e. a sample of the stack trace or impacted account) in addition to the standard error message. | False |
Example
{
"code": 12,
"message": "Invalid account format",
"retriable": true,
"details": {
"address": "0x1dcc4de8dec75d7aab85b567b6",
"error": "not base64"
}
}