Skip to content

Commit

Permalink
=Merge branch 'tomas/better-err-reports' (#____)
Browse files Browse the repository at this point in the history
* origin/tomas/better-err-reports:
  changelog: add #2132
  print eyre errors with inner errors

# Conflicts:
#	shared/src/ledger/protocol/mod.rs
  • Loading branch information
Gianmarco Fraccaroli committed Nov 20, 2023
2 parents bc967b0 + 859b55c commit ed23bc7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
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 @@ -51,7 +51,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 @@ -85,15 +85,15 @@ 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("MASP native VP error: {0}")]
MaspNativeVpError(native_vp::masp::Error),
#[error("Access to an internal address {0} is forbidden")]
#[error("Access to an internal address {0:?} is forbidden")]
AccessForbidden(InternalAddress),
}

Expand Down

0 comments on commit ed23bc7

Please sign in to comment.