Stage 1: CheckTx Rejection (BroadcastTxError)
The node validates the transaction before adding it to the mempool. Common failures include invalid signatures, insufficient funds for fees, or unregistered message types. These throw a BroadcastTxError:
Stage 2: Execution Failure (non-zero code)
If the transaction passes CheckTx but fails during execution (out of gas, business logic error, etc.), signAndBroadcast still returns a DeliverTxResponse — but with a non-zero code. Gas is consumed up to the point of failure.
assertIsDeliverTxSuccess throws an error if the transaction failed, making it useful for fail-fast workflows.
Stage 3: Timeout (TimeoutError)
If the transaction is not included in a block before the polling timeout expires, a TimeoutError is thrown. The transaction may still succeed later:
Full Error Handling Pattern
A robust transaction flow handles all three failure modes:Error Summary
Next Steps
Error Classes
Detailed reference for all CosmJS error classes.
Events & Lookups
Read transaction events and look up past transactions.