diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index bab2363b5..5f16ccf4a 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -866,7 +866,7 @@ impl Host { .msg("error '{}': calling unknown contract function '{}'") .arg::(func.into()), )), - Err(_panic_payload) => { + Err(panic_payload) => { // Return an error indicating the contract function // panicked. If if was a panic generated by a // CheckedEnv-upgraded HostError, it had its status @@ -875,21 +875,21 @@ impl Host { // propagate it. let func: RawVal = func.into(); let mut status: Status = ScUnknownErrorCode::General.into(); - let mut event = DebugEvent::new().msg("Caught panic from contract function '{}'").arg(func); + let mut event = DebugEvent::new().msg("caught panic from contract function '{}'").arg(func); if let Some(st) = *panic.borrow() { status = st; - event = DebugEvent::new().msg("Caught panic from contract function '{}', propagating escalated error '{}'").arg(func); + event = DebugEvent::new().msg("caught panic from contract function '{}', propagating escalated error '{}'").arg(func).arg(st.to_raw()); } // If we're allowed to record dynamic strings (which happens in // native test configurations), also log the panic payload into // the . else if cfg!(feature = "hostfn_log_fmt_values") { - if let Some(str) = _panic_payload.downcast_ref::<&str>() { - let msg: String = format!("Caught panic '{}' from contract function '{:?}'", str, func); + if let Some(str) = panic_payload.downcast_ref::<&str>() { + let msg: String = format!("caught panic '{}' from contract function '{:?}'", str, func); event = DebugEvent::new().msg(msg); - } else if let Some(str) = _panic_payload.downcast_ref::() { - let msg: String = format!("Caught panic '{}' from contract function '{:?}'", str, func); + } else if let Some(str) = panic_payload.downcast_ref::() { + let msg: String = format!("caught panic '{}' from contract function '{:?}'", str, func); event = DebugEvent::new().msg(msg); } }