Skip to content

Commit

Permalink
[Turbopack] In CI report unexpected errors directly (vercel#69997)
Browse files Browse the repository at this point in the history
### What?

In CI report unexpected errors directly instead of writing them to a
file
  • Loading branch information
sokra authored Sep 12, 2024
1 parent 16ed89e commit 05578a1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/napi/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ static PANIC_LOG: Lazy<PathBuf> = Lazy::new(|| {
});

pub fn log_panic_and_inform(err_info: impl Debug) {
if cfg!(debug_assertions) || env::var("SWC_DEBUG") == Ok("1".to_string()) {
eprintln!("{:?}", err_info);
if cfg!(debug_assertions)
|| env::var("SWC_DEBUG") == Ok("1".to_string())
|| env::var("CI").is_ok_and(|v| !v.is_empty())
{
eprintln!(
"{}: An unexpected Turbopack error occurred:\n{:?}",
"FATAL".red().bold(),
err_info
);
return;
}

Expand Down

0 comments on commit 05578a1

Please sign in to comment.