Skip to main content
When a transaction is included in a block but execution fails (e.g. out of gas, insufficient funds, contract panic), broadcastTx does not throw. Instead it returns a DeliverTxResponse with a non-zero code.

Checking Success or Failure

Common Execution Failures

CosmJS does not define constants for Cosmos SDK error codes. The code and codespace fields are passed through from the node. Inspect rawLog (SDK < 0.50) or events (SDK 0.50+) for human-readable details.

CosmWasm Convenience Methods

Methods like upload, instantiate, execute, and migrate on SigningCosmWasmClient throw a plain Error when isDeliverTxFailure is true, instead of returning the DeliverTxResponse: