Skip to content

Commit 003ccad

Browse files
Copilotdevlux76
andauthored
fix: ensure WebGL→WASM fallback catches synchronous throws (#86)
* Initial plan * fix: wrap WebGlVectorBackend.create() in .then() to capture synchronous throws for WASM fallback Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
1 parent b734f07 commit 003ccad

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/CreateVectorBackend.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export async function createVectorBackend(
1515
);
1616
}
1717
if (kind === "webgl") {
18-
return Promise.resolve(WebGlVectorBackend.create()).catch(() =>
19-
WasmVectorBackend.create(wasmBytes)
20-
);
18+
return Promise.resolve()
19+
.then(() => WebGlVectorBackend.create())
20+
.catch(() => WasmVectorBackend.create(wasmBytes));
2121
}
2222
if (kind === "webnn") {
2323
return WebNnVectorBackend.create(wasmBytes).catch(() =>

0 commit comments

Comments
 (0)