Skip to main content
CosmJS surfaces errors at two levels: transport-level errors from the RPC client, and broadcast-level errors from transaction submission.

Transport-Level Errors

Broadcast Errors

When a signed transaction is submitted but rejected during CheckTx (for example, insufficient fees or an invalid signature), the client throws a BroadcastTxError:

Timeout Errors

When a transaction is submitted successfully but not included in a block before the timeout expires, the client throws a TimeoutError with the transaction hash:
A TimeoutError does not mean the transaction failed — it may still be included in a later block. You can query for it later using client.getTx(error.txId).

Fire-and-Forget Broadcasting

If you don’t want to wait for block inclusion, use signAndBroadcastSync to get the transaction hash immediately after submission:
This avoids the polling loop and the TimeoutError entirely. Use it when your application handles confirmation tracking separately.

No Built-In Retry

Neither HttpClient nor HttpBatchClient retry failed requests. If your application needs retry logic for transient network errors, wrap the RPC client or implement retries at the application level.

Next Steps

Timeouts

Configure timeout values to tune error behavior.

Connect to a Chain

Return to the connection overview.