pub struct PanicData {
pub message: Option<String>,
pub location: Option<String>,
pub payload: Option<String>,
}Expand description
Represents detailed information about a panic that has occurred within the server.
This struct captures essential details about a panic, such as the message, source code location, and payload. It is used by the server’s panic handling mechanism and passed to the configured panic hook for custom processing.
Fields§
§message: Option<String>The message associated with the panic.
This is None if the panic payload is not a string.
location: Option<String>The source code location where the panic occurred.
payload: Option<String>The payload of the panic, often a string literal.
The hook attempts to downcast it to a &str or String.
Implementations§
Source§impl PanicData
Implementation of methods for the PanicData struct.
impl PanicData
Implementation of methods for the PanicData struct.
Sourcepub fn from_join_error(join_error: JoinError) -> Self
pub fn from_join_error(join_error: JoinError) -> Self
Creates a PanicData instance from a tokio::task::JoinError.
This is used to handle panics that occur within spawned asynchronous tasks,
extracting the panic message from the JoinError.
§Arguments
JoinError- The error from a panicked task.
§Returns
PanicData- A new panic instance with message from error.