1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-03-24 19:09:22 +00:00

Fix panic hook

This commit is contained in:
Alula 2024-08-28 18:45:22 +02:00
parent 156f2b202b
commit 024d5ec78f
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -300,14 +300,8 @@ fn init_logger() -> GameResult {
fn panic_hook(info: &PanicInfo<'_>) {
let backtrace = Backtrace::force_capture();
let msg = info.payload().downcast_ref::<&str>().unwrap_or(&"");
let location = info.location();
if location.is_some() {
log::error!("Panic occurred in {} with message: '{msg}'\n {backtrace:#}", location.unwrap().to_string());
} else {
log::error!("Panic occurred with message: '{msg}'\n {backtrace:#}");
}
log::error!("Panic occurred: {info}\n {backtrace:#}");
}
pub fn init(options: LaunchOptions) -> GameResult {