MCPcopy Create free account
hub / github.com/DjDeveloperr/deno_desktop / patchPushError

Function patchPushError

examples/extern/gpu_err.bundle.js:1–12  ·  view source on GitHub ↗
(proto, throwError)

Source from the content-addressed store, hash-verified

1function patchPushError(proto, throwError) {
2 const _pushError = proto.pushError;
3 proto.pushError = function(error) {
4 if (error !== null && error.type === "validation") {
5 const err = new Error(error.value ?? "unknown");
6 err.name = "WebGPUValidationError";
7 if (throwError) throw err;
8 else console.error(err);
9 }
10 _pushError.call(proto, error);
11 };
12}
13function enableValidationErrors(device, throwError = false) {
14 const _InnerDevice = Object.getOwnPropertySymbols(device).find((e)=>e.description === "[[device]]"
15 );

Callers 1

enableValidationErrorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected