Skip to content

Commit 05578a1

Browse files
authored
[Turbopack] In CI report unexpected errors directly (#69997)
### What? In CI report unexpected errors directly instead of writing them to a file
1 parent 16ed89e commit 05578a1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/napi/src/util.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ static PANIC_LOG: Lazy<PathBuf> = Lazy::new(|| {
5353
});
5454

5555
pub fn log_panic_and_inform(err_info: impl Debug) {
56-
if cfg!(debug_assertions) || env::var("SWC_DEBUG") == Ok("1".to_string()) {
57-
eprintln!("{:?}", err_info);
56+
if cfg!(debug_assertions)
57+
|| env::var("SWC_DEBUG") == Ok("1".to_string())
58+
|| env::var("CI").is_ok_and(|v| !v.is_empty())
59+
{
60+
eprintln!(
61+
"{}: An unexpected Turbopack error occurred:\n{:?}",
62+
"FATAL".red().bold(),
63+
err_info
64+
);
5865
return;
5966
}
6067

0 commit comments

Comments
 (0)