MCPcopy Create free account
hub / github.com/MetaMask/rpc-errors / isJsonRpcServerError

Function isJsonRpcServerError

src/utils.ts:195–197  ·  view source on GitHub ↗

* Check if the given code is a valid JSON-RPC server error code. * * @param code - The error code. * @returns Whether the given code is a valid JSON-RPC server error code.

(code: number)

Source from the content-addressed store, hash-verified

193 * @returns Whether the given code is a valid JSON-RPC server error code.
194 */
195function isJsonRpcServerError(code: number): boolean {
196 return code >= -32099 && code <= -32000;
197}
198
199/**
200 * Serializes an unknown error to be used as the `cause` in a fallback error.

Callers 1

getMessageFromCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…