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

In Context::handle_error_fatal, print cause chain. #3563

Merged
merged 3 commits into from
Mar 7, 2023
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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