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

This commit is contained in:
Kevin Reid
2023-03-06 20:00:34 -08:00
committed by GitHub
parent cf40e64b16
commit 13d2c3673c
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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 {