Skip to content

Commit ee16597

Browse files
committed
Improve error
1 parent 5f47651 commit ee16597

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

wgpu/src/backend/webgpu.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,9 +1124,12 @@ impl ContextWebGpu {
11241124
let context: webgpu_sys::GpuCanvasContext =
11251125
context
11261126
.dyn_into()
1127-
.map_err(|_| crate::CreateSurfaceError {
1127+
.map_err(|actual| crate::CreateSurfaceError {
11281128
inner: crate::CreateSurfaceErrorKind::Web(
1129-
"canvas.getContext() failed: This is likely because WebGPU is disabled in this browser.".into(),
1129+
format!(
1130+
"canvas.getContext() returned a value that did not coerce to GPUCanvasContext. This is likely because WebGPU is disabled in this browser. Expected: GPUCanvasContext, Actual: {}",
1131+
actual.to_string()
1132+
)
11301133
),
11311134
})?;
11321135

0 commit comments

Comments
 (0)