Skip to content

Commit

Permalink
Display backtraces with errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinling committed Jan 8, 2024
1 parent 12a8c68 commit 039445b
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
69 changes: 69 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ arc-swap = "1.6.0"
lrumap = "0.1.0"
memmap2 = "0.5.8"
page_size = "0.5.0"
anyhow = "1.0.79"
anyhow = { version = "1.0.79", features = ["backtrace"] }

[dev-dependencies]
serde = { version = "1.0.136", features = ["derive"] }
Expand Down
3 changes: 2 additions & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,8 @@ pub fn stop_luna() -> Result<(), Error> {
pub fn display_error(result: Result<(), Error>) {
#[cfg(not(feature="test-ui-replay"))]
if let Err(e) = result {
let message = format!("{e}");
let backtrace = e.backtrace();
let message = format!("{e}\n\nBacktrace:\n\n{backtrace}");
gtk::glib::idle_add_once(move || {
WINDOW.with(|win_opt| {
match win_opt.borrow().as_ref() {
Expand Down

0 comments on commit 039445b

Please sign in to comment.