Type Definition
Quick Start
Error Code Constants
Standard JSON-RPC 2.0
Ethereum-Specific (EIP-1474)
Server error range:-32000 to -32099
API Reference
from()
Create error from code and message:
code: number | JsonRpcErrorType- Error code or error objectmessage?: string- Error messagedata?: unknown- Additional error data
JsonRpcErrorType
toString()
Format error as string:
error: JsonRpcErrorType- Error object
string - Formatted error string
Common Patterns
Execution Reverted
The-32000 error code is most common for contract execution failures:
Error Code Checking
Error Messages Lookup
Tree-Shaking
Import only what you need:Specifications
Related
- Error Handling - Provider error handling patterns
- JsonRpcResponse - Response type with error union
- JsonRpcRequest - Request structure

