Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
h-a-n-a committed Dec 7, 2023
1 parent f8b4436 commit 44bdce7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion crates/node_binding/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ pub fn install_panic_handler() {
#[cfg(debug_assertions)]
{
use rspack_core::debug_info::DEBUG_INFO;
eprintln!("{}", DEBUG_INFO.lock().unwrap());
if let Ok(info) = DEBUG_INFO.lock() {
eprintln!("{}", info);
}
}
panic_handler(panic);
}))
Expand Down
7 changes: 3 additions & 4 deletions crates/rspack_core/src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ where
pub fn new(options: CompilerOptions, plugins: Vec<BoxPlugin>, output_filesystem: T) -> Self {
#[cfg(debug_assertions)]
{
crate::debug_info::DEBUG_INFO
.lock()
.unwrap()
.with_context(options.context.to_string());
if let Ok(mut debug_info) = crate::debug_info::DEBUG_INFO.lock() {
debug_info.with_context(options.context.to_string());
}
}
let new_resolver = options.experiments.rspack_future.new_resolver;
let resolver_factory = Arc::new(ResolverFactory::new(new_resolver, options.resolve.clone()));
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_core/src/debug_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ macro_rules! write_debug_info {
let e = format!("\u{001b}[1m\u{001b}[33m{tt}\u{001b}[0m: {e}");
writeln!($f, "{}", e)?;
} else {
let e = format!("{tt}: <empty>");
let e = format!("\u{001b}[1m\u{001b}[33m{tt}\u{001b}[0m: <empty>");
writeln!($f, "{}", e)?;
}
};
Expand Down

0 comments on commit 44bdce7

Please sign in to comment.