Skip to content

Commit fd6f528

Browse files
authored
Capture String Panic Messages (#962)
1 parent b927092 commit fd6f528

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lambda-runtime/src/layers/panic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ impl<F> CatchPanicFuture<'_, F> {
9999
fn build_panic_diagnostic(err: &Box<dyn Any + Send>) -> Diagnostic {
100100
let error_message = if let Some(msg) = err.downcast_ref::<&str>() {
101101
format!("Lambda panicked: {msg}")
102+
} else if let Some(msg) = err.downcast_ref::<String>() {
103+
format!("Lambda panicked: {msg}")
102104
} else {
103105
"Lambda panicked".to_string()
104106
};

0 commit comments

Comments
 (0)