Skip to content

Commit

Permalink
Capture String Panic Messages
Browse files Browse the repository at this point in the history
  • Loading branch information
George-lewis committed Feb 10, 2025
1 parent f69280e commit 7787169
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lambda-runtime/src/layers/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl<F> CatchPanicFuture<'_, F> {
fn build_panic_diagnostic(err: &Box<dyn Any + Send>) -> Diagnostic {
let error_message = if let Some(msg) = err.downcast_ref::<&str>() {
format!("Lambda panicked: {msg}")
} else if let Some(msg) = err.downcast_ref::<String>() {
format!("Lambda panicked: {msg}")
} else {
"Lambda panicked".to_string()
};
Expand Down

0 comments on commit 7787169

Please sign in to comment.