Error handling
Most transaction failures fall into three categories: contract reverts, wallet rejections, and RPC errors. This page shows how to decode each type and respond correctly.Try it: see real errors
TheRunSnippet widget shows whatever the RPC returns, including failures. These two live calls to Sei Mainnet fail on purpose. They show the exact error shape that your code has to handle.
Contract reverts
When a transaction reverts and the contract gives a revert reason, the error contains that reason.Simulating before sending
Always simulate write calls before you submit them. Simulation runs the call against the current chain state and reports reverts before you spend gas:viem