diff --git a/CHANGELOG.md b/CHANGELOG.md index f796978dd1..7608d61496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/wgpu/src/backend/direct.rs b/wgpu/src/backend/direct.rs index 115594998f..e3f6bbc6c5 100644 --- a/wgpu/src/backend/direct.rs +++ b/wgpu/src/backend/direct.rs @@ -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 {