Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print eyre errors with inner errors #2132

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/2132-better-err-reports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Print more context from eyre error types.
([\#2132](https://github.com/anoma/namada/pull/2132))
2 changes: 1 addition & 1 deletion apps/src/lib/config/genesis/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ pub fn load_and_validate(templates_dir: &Path) -> Option<All<Validated>> {
let transactions = read_transactions(&transactions_file);

let eprintln_invalid_file = |err: &eyre::Report, name: &str| {
eprintln!("{name} file is NOT valid. Failed to read with: {err}");
eprintln!("{name} file is NOT valid. Failed to read with: {err:?}");
};

// Check the parsing results
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/node/ledger/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub enum Error {
Broadcaster(tokio::sync::mpsc::error::TryRecvError),
#[error("Error executing proposal {0}: {1}")]
BadProposal(u64, String),
#[error("Error reading wasm: {0}")]
#[error("Error reading wasm: {0:?}")]
ReadingWasm(#[from] eyre::Error),
#[error("Error loading wasm: {0}")]
LoadingWasm(String),
Expand Down
10 changes: 5 additions & 5 deletions shared/src/ledger/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Error {
TxDecodingError(proto::Error),
#[error("Transaction runner error: {0}")]
TxRunnerError(vm::wasm::run::Error),
#[error(transparent)]
#[error("{0:?}")]
ProtocolTxError(#[from] eyre::Error),
#[error("Txs must either be encrypted or a decryption of an encrypted tx")]
TxTypeError,
Expand Down Expand Up @@ -84,13 +84,13 @@ pub enum Error {
GovernanceNativeVpError(crate::ledger::governance::Error),
#[error("Pgf native VP error: {0}")]
PgfNativeVpError(crate::ledger::pgf::Error),
#[error("Ethereum bridge native VP error: {0}")]
#[error("Ethereum bridge native VP error: {0:?}")]
EthBridgeNativeVpError(native_vp::ethereum_bridge::vp::Error),
#[error("Ethereum bridge pool native VP error: {0}")]
#[error("Ethereum bridge pool native VP error: {0:?}")]
BridgePoolNativeVpError(native_vp::ethereum_bridge::bridge_pool_vp::Error),
#[error("Non usable tokens native VP error: {0}")]
#[error("Non usable tokens native VP error: {0:?}")]
NutNativeVpError(native_vp::ethereum_bridge::nut::Error),
#[error("Access to an internal address {0} is forbidden")]
#[error("Access to an internal address {0:?} is forbidden")]
AccessForbidden(InternalAddress),
}

Expand Down