Skip to content

Commit 823513a

Browse files
authored
Merge pull request #642 from CosmWasm/handle_vm_panic-err-display
Use Display representation of err: &str
2 parents 8e6e649 + c4eef51 commit 823513a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libwasmvm/src/handle_vm_panic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ use std::any::Any;
55
/// We want to provide as much debug information as possible
66
/// as those cases are not expected to happen during healthy operations.
77
pub fn handle_vm_panic(what: &str, err: Box<dyn Any + Send + 'static>) {
8-
let err = match (err.downcast_ref::<&str>(), err.downcast_ref::<String>()) {
9-
(Some(str), ..) => *str,
8+
let err: &str = match (err.downcast_ref::<&str>(), err.downcast_ref::<String>()) {
9+
(Some(str), ..) => str,
1010
(.., Some(str)) => str,
1111
(None, None) => "[unusable panic payload]",
1212
};
1313

1414
eprintln!("Panic in {what}:");
15-
eprintln!("{err:?}");
15+
eprintln!("{err}");
1616
eprintln!(
1717
"This indicates a panic in during the operations of libwasmvm/cosmwasm-vm.
1818
Such panics must not happen and are considered bugs. If you see this in any real-world or

0 commit comments

Comments
 (0)