MCPcopy Create free account
hub / github.com/0xMiden/node / stringify_panic_error

Function stringify_panic_error

crates/utils/src/panic.rs:32–40  ·  view source on GitHub ↗

Converts a dynamic panic-related error into a string.

(err: Box<dyn Any + Send + 'static>)

Source from the content-addressed store, hash-verified

30
31/// Converts a dynamic panic-related error into a string.
32fn stringify_panic_error(err: Box<dyn Any + Send + 'static>) -> String {
33 if let Some(&msg) = err.downcast_ref::<&str>() {
34 msg.to_string()
35 } else if let Ok(msg) = err.downcast::<String>() {
36 *msg
37 } else {
38 "unknown".to_string()
39 }
40}

Callers 1

catch_panic_layer_fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected