1
Fork 0
mirror of https://github.com/redstrate/LauncherTweaks.git synced 2025-05-20 17:37:46 +00:00

Emit file and line info in panics if available

This commit is contained in:
Joshua Goins 2025-05-03 18:21:32 -04:00
parent 9328424259
commit c166df7858

View file

@ -437,7 +437,15 @@ fn main() {
"Unknown error".to_string() "Unknown error".to_string()
}; };
if let Some(location) = panic_hook_info.location() {
show_message(&format!(
"Error: {s} in file '{}' at line {}",
location.file(),
location.line()
));
} else {
show_message(&format!("Error: {s}")); show_message(&format!("Error: {s}"));
}
})); }));
let current_exe = std::env::current_exe().expect("Failed to get executable path"); let current_exe = std::env::current_exe().expect("Failed to get executable path");