An error with any other code (a resource not found, ...).
Attributes#
| Attribute | Type | Description |
|---|---|---|
error_code | int = INTERNAL_ERROR_CODE | |
code | int |
Functions#
__init__#
__init__(message, data=None, error_code=INTERNAL_ERROR_CODE) -> None| Parameter | Type | Description |
|---|---|---|
message | str | |
data | JsonValue = None | |
error_code | int = INTERNAL_ERROR_CODE |
to_wire#
to_wire() -> JsonRpcErrorObjectReturns JsonRpcErrorObject
def to_wire(self) -> JsonRpcErrorObject:
error: JsonRpcErrorObject = {"code": self.code, "message": self.message}
if self.data is not None:
error["data"] = self.data
return error