Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic message boxes #2086

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Release

# editor
.vs/
.idea/

# NuGet Packages
*.nupkg
Expand Down
6 changes: 4 additions & 2 deletions alvr/common/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ pub fn set_panic_hook() {
Backtrace::new()
);

log::error!("{err_str}");
let short_err_str = panic_info.to_string();

log::error!("ALVR panicked: {err_str}");

#[cfg(all(not(target_os = "android"), feature = "enable-messagebox"))]
std::thread::spawn(move || {
rfd::MessageDialog::new()
.set_title("ALVR panicked")
.set_description(&err_str)
.set_description(&short_err_str)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use panic_info directly here?

.set_level(rfd::MessageLevel::Error)
.show();
});
Expand Down
Loading