Skip to content

Commit cf44334

Browse files
fixup! Improve error
1 parent ee16597 commit cf44334

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

wgpu/src/backend/webgpu.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,12 +1125,15 @@ impl ContextWebGpu {
11251125
context
11261126
.dyn_into()
11271127
.map_err(|actual| crate::CreateSurfaceError {
1128-
inner: crate::CreateSurfaceErrorKind::Web(
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: {}",
1128+
inner: crate::CreateSurfaceErrorKind::Web(format!(
1129+
concat!(
1130+
"`canvas.getContext()` returned a value that did not coerce to ",
1131+
"`GPUCanvasContext`. ",
1132+
"This is likely because WebGPU is disabled in this browser. ",
1133+
"Expected: GPUCanvasContext, Actual: {}"
1134+
),
11311135
actual.to_string()
1132-
)
1133-
),
1136+
)),
11341137
})?;
11351138

11361139
Ok(WebSurface {

0 commit comments

Comments
 (0)