code and message field inside the error key of the response.
Standard JSON-RPC error codes
Ethereum execution errors
Decoding revert reasons
When a transaction reverts, thedata field may contain an ABI-encoded revert reason:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Standard and Autheo-specific JSON-RPC error codes and how to handle them.
code and message field inside the error key of the response.
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "Method not found"
}
}
| Code | Name | Description |
|---|---|---|
-32700 | Parse error | Invalid JSON was received |
-32600 | Invalid request | The JSON is not a valid request object |
-32601 | Method not found | The method does not exist or is unsupported |
-32602 | Invalid params | Invalid method parameters |
-32603 | Internal error | Internal JSON-RPC server error |
-32000 to -32099 | Server error | Implementation-defined server errors |
| Code | Message | Description |
|---|---|---|
-32000 | execution reverted | Contract execution reverted — check the data field for the revert reason |
-32000 | insufficient funds for gas * price + value | Sender balance too low |
-32000 | nonce too low | Transaction nonce is lower than the account’s current nonce |
-32000 | nonce too high | Transaction nonce is too far ahead of the current nonce |
-32000 | gas limit reached | Block gas limit exceeded |
-32000 | already known | Transaction already in mempool |
data field may contain an ABI-encoded revert reason:
import { ethers } from "ethers";
try {
await contract.myFunction(args);
} catch (err) {
if (err.data) {
// Try to decode as a standard Error(string) revert
try {
const decoded = ethers.toUtf8String("0x" + err.data.slice(138));
console.error("Revert reason:", decoded);
} catch {
console.error("Raw revert data:", err.data);
}
}
}
| Error | Likely cause | Fix |
|---|---|---|
-32601 Method not found | Method not supported by this node | Check supported methods |
-32000 execution reverted | Contract require() or revert() triggered | Simulate with eth_call first to get revert reason |
-32000 insufficient funds | Low balance | Fund the sender account |
-32000 nonce too low | Stale nonce in client | Refresh nonce with eth_getTransactionCount |