Function create_error_response

Source
pub fn create_error_response(
    id: Option<JsonRpcId>,
    code: i32,
    message: &str,
    description: &str,
) -> JsonRpcResponse<NetworkRpcResult>
Expand description

Creates an error response following the JSON-RPC 2.0 specification.

§Arguments

  • id - The request ID from the original JSON-RPC request
  • code - The error code (should follow JSON-RPC error code conventions)
  • message - A short, human-readable error message
  • description - A more detailed description of the error

§Returns

Returns a JsonRpcResponse<NetworkRpcResult> containing the error details and no result data.