Skip to content

Commit

Permalink
Improved fee-related error message (informalsystems#2261)
Browse files Browse the repository at this point in the history
* Added handler for SDK Err(13) to output understandable error meaning

* Added changelog entry for error handling improvement
  • Loading branch information
ljoss17 authored Jun 3, 2022
1 parent f6d9006 commit 86fead2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Added handler for SDK Err(13) in order to output an understanble error
message. ([#1400](https://github.com/informalsystems/ibc-rs/issues/1400))
5 changes: 5 additions & 0 deletions relayer/src/sdk_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ define_error! {
|e| { format!("unknown SDK error: {}", e.code) },

OutOfGas
{ code: u32 }
|_| { "the gas requirement is higher than the configured maximum gas! please check the Hermes config.toml".to_string() },

InsufficientFee
{ code: u32 }
|_| { "the price configuration for this chain may be too low! please check the `gas_price.price` Hermes config.toml".to_string() },
}
Expand Down Expand Up @@ -181,6 +185,7 @@ pub fn sdk_error_from_tx_sync_error_code(code: u32) -> SdkError {
// is due to "out of gas" errors. These are unrecoverable at the moment
// on the Hermes side. We'll inform the user to check for misconfig.
11 => SdkError::out_of_gas(code),
13 => SdkError::insufficient_fee(code),
_ => SdkError::unknown_sdk(code),
}
}

0 comments on commit 86fead2

Please sign in to comment.