Skip to content

Commit

Permalink
Merge pull request #1235 from hannobraun/error
Browse files Browse the repository at this point in the history
Improve error message, if model can't be loaded
  • Loading branch information
hannobraun authored Oct 19, 2022
2 parents 8632b06 + e725103 commit 49d3ac0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/fj-window/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,20 @@ pub fn run(
}
}
Err(err) => {
// Can be cleaned up, once `Report` is stable:
// https://doc.rust-lang.org/std/error/struct.Report.html

println!("Error receiving updated shape: {}", err);

let mut current_err = &err as &dyn error::Error;
while let Some(err) = current_err.source() {
println!();
println!("Caused by:");
println!(" {}", err);

current_err = err;
}

*control_flow = ControlFlow::Exit;
return;
}
Expand Down

0 comments on commit 49d3ac0

Please sign in to comment.