Skip to content

Commit

Permalink
add error print
Browse files Browse the repository at this point in the history
  • Loading branch information
lorbax committed May 14, 2024
1 parent 2fd4a02 commit f180626
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/message-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::{
},
vec::Vec,
};
use tracing::info;
use tracing::{error, info};
use tracing_core::{Event, Subscriber};
use tracing_subscriber::{
filter::EnvFilter,
Expand Down Expand Up @@ -408,7 +408,8 @@ async fn main() {
let pass = Arc::new(AtomicBool::new(false));
{
let fail = fail.clone();
std::panic::set_hook(Box::new(move |_| {
std::panic::set_hook(Box::new(move |info| {
error!("{:#?}", info);
fail.store(true, Ordering::Relaxed);
}));
}
Expand All @@ -430,6 +431,7 @@ async fn main() {
});
}
loop {
tokio::task::yield_now().await;
if fail.load(Ordering::Relaxed) {
clean_up(cleanup).await;
let _ = std::panic::take_hook();
Expand Down

0 comments on commit f180626

Please sign in to comment.