Skip to content

Commit

Permalink
refactor: consistent behavior for showing error trace in proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
deciduously committed Dec 5, 2024
1 parent 4ec400f commit b950a34
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
8 changes: 7 additions & 1 deletion packages/rust/proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ fn main() {

if let Err(e) = main_inner() {
eprintln!("rustc proxy failed: {e}");
eprintln!("{}", e.trace(&tg::error::TraceOptions::default()));
eprintln!(
"{}",
e.trace(&tg::error::TraceOptions {
internal: true,
reverse: false,
})
);
std::process::exit(1);
}
}
Expand Down
7 changes: 7 additions & 0 deletions packages/std/packages/cc_proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ impl Args {
fn main() {
if let Err(e) = main_inner() {
eprintln!("cc proxy failed: {e}");
eprintln!(
"{}",
e.trace(&tg::error::TraceOptions {
internal: true,
reverse: false,
})
);
std::process::exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/std/packages/ld_proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const MAX_DEPTH: usize = 16;
fn main() {
if let Err(e) = main_inner() {
eprintln!("linker proxy failed: {e}");
tracing::error!(
eprintln!(
"{}",
e.trace(&tg::error::TraceOptions {
internal: true,
Expand Down
8 changes: 7 additions & 1 deletion packages/std/packages/strip_proxy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ fn main() {

if let Err(e) = main_inner() {
eprintln!("strip proxy failed: {e}");
eprintln!("{}", e.trace(&tg::error::TraceOptions::default()));
eprintln!(
"{}",
e.trace(&tg::error::TraceOptions {
internal: true,
reverse: false,
})
);
std::process::exit(1);
}
}
Expand Down

0 comments on commit b950a34

Please sign in to comment.