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:
parent
9328424259
commit
c166df7858
1 changed files with 9 additions and 1 deletions
10
src/lib.rs
10
src/lib.rs
|
@ -437,7 +437,15 @@ fn main() {
|
|||
"Unknown error".to_string()
|
||||
};
|
||||
|
||||
show_message(&format!("Error: {s}"));
|
||||
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}"));
|
||||
}
|
||||
}));
|
||||
|
||||
let current_exe = std::env::current_exe().expect("Failed to get executable path");
|
||||
|
|
Loading…
Add table
Reference in a new issue