Skip to content

Commit

Permalink
fix: use Debug when formatting errors (#9251)
Browse files Browse the repository at this point in the history
* fix: use Debug when formatting errors

* sh_err

* rm newline in handler
  • Loading branch information
klkvr authored Nov 2, 2024
1 parent d402afd commit 8660e5b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/anvil/src/anvil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum AnvilSubcommand {

fn main() {
if let Err(err) = run() {
let _ = foundry_common::Shell::get().error(&err);
let _ = foundry_common::sh_err!("{err:?}");
std::process::exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
if let Err(err) = run() {
let _ = foundry_common::Shell::get().error(&err);
let _ = foundry_common::sh_err!("{err:?}");
std::process::exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/chisel/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub enum ChiselSubcommand {

fn main() {
if let Err(err) = run() {
let _ = foundry_common::Shell::get().error(&err);
let _ = foundry_common::sh_err!("{err:?}");
std::process::exit(1);
}
}
Expand Down
1 change: 0 additions & 1 deletion crates/cli/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ impl EyreHandler for Handler {
if f.alternate() {
return core::fmt::Debug::fmt(error, f)
}
writeln!(f)?;
write!(f, "{}", error.red())?;

if let Some(cause) = error.source() {
Expand Down
2 changes: 1 addition & 1 deletion crates/forge/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
if let Err(err) = run() {
let _ = foundry_common::Shell::get().error(&err);
let _ = foundry_common::sh_err!("{err:?}");
std::process::exit(1);
}
}
Expand Down

0 comments on commit 8660e5b

Please sign in to comment.