Skip to content

Commit 3df463a

Browse files
committed
Add thread name to panic dialogs
1 parent 01d287c commit 3df463a

File tree

1 file changed

+5
-1
lines changed
  • frontend/desktop/src

1 file changed

+5
-1
lines changed

frontend/desktop/src/ui.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,14 @@ impl FbTexture {
838838
pub fn main() {
839839
let panic_hook = panic::take_hook();
840840
panic::set_hook(Box::new(move |info| {
841+
let thread = std::thread::current();
842+
let thread_name = thread.name().unwrap_or("<unnamed>");
843+
841844
error!(
842845
"Unexpected panic",
843-
"Encountered unexpected panic: {}\n\nThe emulator will now quit.", info
846+
"Thread \"{thread_name}\" {info}\n\nThe emulator will now quit."
844847
);
848+
845849
panic_hook(info);
846850
std::process::exit(1);
847851
}));

0 commit comments

Comments
 (0)