Skip to content

Commit

Permalink
fix: show worker backtrace on panic
Browse files Browse the repository at this point in the history
  • Loading branch information
delehef committed Oct 24, 2024
1 parent be6a8a9 commit 4e72ece
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lgn-worker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ where
}
},
Err(panic) => {
let bt = std::backtrace::Backtrace::force_capture();
let msg = match panic.downcast_ref::<&'static str>() {
Some(s) => *s,
None => match panic.downcast_ref::<String>() {
Expand All @@ -506,12 +507,12 @@ where
},
};

error!("panic encountered during proving: {msg}");
error!("panic encountered during proving: {msg}: {bt:?}",);
counter!("zkmr_worker_error_count",
"error_type" => "proof
processing")
.increment(1);
UpstreamPayload::ProvingError(msg.to_string())
UpstreamPayload::ProvingError(format!("{}: {bt:?}", msg))
}
};
counter!("zkmr_worker_websocket_messages_sent_total",
Expand Down

0 comments on commit 4e72ece

Please sign in to comment.