Skip to main content
JSON-RPC errors are returned as objects with a code and message field inside the error key of the response.
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}

Standard JSON-RPC error codes

CodeNameDescription
-32700Parse errorInvalid JSON was received
-32600Invalid requestThe JSON is not a valid request object
-32601Method not foundThe method does not exist or is unsupported
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal JSON-RPC server error
-32000 to -32099Server errorImplementation-defined server errors

Ethereum execution errors

CodeMessageDescription
-32000execution revertedContract execution reverted — check the data field for the revert reason
-32000insufficient funds for gas * price + valueSender balance too low
-32000nonce too lowTransaction nonce is lower than the account’s current nonce
-32000nonce too highTransaction nonce is too far ahead of the current nonce
-32000gas limit reachedBlock gas limit exceeded
-32000already knownTransaction already in mempool

Decoding revert reasons

When a transaction reverts, the 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);
    }
  }
}

Common causes and fixes

ErrorLikely causeFix
-32601 Method not foundMethod not supported by this nodeCheck supported methods
-32000 execution revertedContract require() or revert() triggeredSimulate with eth_call first to get revert reason
-32000 insufficient fundsLow balanceFund the sender account
-32000 nonce too lowStale nonce in clientRefresh nonce with eth_getTransactionCount