Skip to content

Commit

Permalink
In Context::handle_error_fatal, print cause chain. (#3563)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid authored Mar 7, 2023
1 parent cf40e64 commit 13d2c36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ By @teoxoy in [#3534](https://github.com/gfx-rs/wgpu/pull/3534)

- `copyTextureToTexture` src/dst aspects must both refer to all aspects of src/dst format. By @teoxoy in [#3431](https://github.com/gfx-rs/wgpu/pull/3431)
- Validate before extracting texture selectors. By @teoxoy in [#3487](https://github.com/gfx-rs/wgpu/pull/3487)
- Fix fatal errors (those which panic even if an error handler is set) not including all of the details. By @kpreid in [#3563](https://github.com/gfx-rs/wgpu/pull/3563)

#### Vulkan

Expand Down
5 changes: 3 additions & 2 deletions wgpu/src/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,13 @@ impl Context {
self.handle_error(sink_mutex, cause, "", None, string)
}

#[track_caller]
fn handle_error_fatal(
&self,
cause: impl Error + Send + Sync + 'static,
string: &'static str,
operation: &'static str,
) -> ! {
panic!("Error in {string}: {cause}");
panic!("Error in {operation}: {f}", f = self.format_error(&cause));
}

fn format_error(&self, err: &(impl Error + 'static)) -> String {
Expand Down

0 comments on commit 13d2c36

Please sign in to comment.