json_rpc/errors

Source   Edit  

Types

ApplicationError {....deprecated: "RpcResponseError".} = object of JsonRpcError
  code*: int
  data*: Opt[JsonString]
Deprecated: RpcResponseError
Source   Edit  
ErrorResponse = object of RpcTransportError
  status*: int ## Raised when the server responds with a HTTP-style error status code
               ## indicating that the call was not processed
Source   Edit  
FailedHttpResponse {....deprecated: "RpcTransportError".} = RpcTransportError
Deprecated: RpcTransportError
Obsolete name for RpcTransportError Source   Edit  
InvalidRequest {....deprecated: "RpcResponseError".} = ApplicationError
Deprecated: RpcResponseError
Source   Edit  
InvalidResponse = object of JsonRpcError
  payload*: seq[byte]
raised when the server response violates the JSON-RPC protocol Source   Edit  
JsonRpcError = object of CatchableError
Base type of all nim-json-rpc errors Source   Edit  
ParamsMismatchError = object of JsonRpcError
Error raised internally when params fail to match the method signature Source   Edit  
RequestDecodeError = object of JsonRpcError
  payload*: seq[byte]
raised when fail to decode RequestRx Source   Edit  
ResultDecodeError = object of JsonRpcError
  result*: JsonString
raised when failing to decode the response result Source   Edit  
RpcApplicationError = object of RpcResponseError
Error to be raised by the application request handlers when the server needs to respond with a custom application error. The error code should be outside the range of -32768 to -32000. A custom JSON data object may be provided. Source   Edit  
RpcBindError = object of JsonRpcError
Source   Edit  
RpcOrigin {.pure.} = enum
  rpcLocal = "local", rpcRemote = "remote"
Source   Edit  
RpcPostError = object of RpcTransportError
raised when the underlying transport fails to send the request - the underlying client may or may not have received the request Source   Edit  
RpcResponseError = object of JsonRpcError
  origin*: RpcOrigin
  code*: int
  data*: JsonString
Base error for all server error responses Source   Edit  
RpcTransportError = object of JsonRpcError
Raised when there is an issue with the underlying transport - the parent exception may be set to provide more information Source   Edit  

Procs

proc new(T: type RpcResponseError; code: int; msg: sink string;
         data: sink JsonString = default(JsonString);
         origin: RpcOrigin = RpcOrigin.rpcLocal): ref RpcResponseError {.
    ...raises: [], gcsafe.}
Source   Edit