Skip to content

RpcResponse.parseError

Parses a JSON-RPC error object into an error instance.

Imports

Named
import { RpcResponse } from 'ox'

Examples

import { RpcResponse } from 'ox'
 
const error = RpcResponse.parseError({ code: -32000, message: 'unsupported method' })
 
const error: RpcResponse.InvalidInputError
error

Definition

function parseError<errorObject>(
  errorObject: errorObject | ErrorObject,
): parseError.ReturnType<errorObject>

Source: src/core/RpcResponse.ts

Parameters

errorObject

  • Type: errorObject | ErrorObject

JSON-RPC error object.

Return Type

Error instance.

parseError.ReturnType<errorObject>