GPUUncapturedErrorEvent
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
Note: This feature is available inWeb Workers.
TheGPUUncapturedErrorEvent
interface of theWebGPU API is the event object type for theGPUDevice
uncapturederror
event, used for telemetry and to report unexpected errors.
Known error cases should be handled usingpushErrorScope()
andpopErrorScope()
.
In this article
Constructor
GPUUncapturedErrorEvent()
Creates a new
GPUUncapturedErrorEvent
object instance.
Instance properties
Inherits properties from its parent,Event
.
Examples
You could use something like the following as a global mechanism to pick up any errors that aren't handled by error scopes and capture them.
js
// …device.addEventListener("uncapturederror", (event) => { // Re-surface the error console.error("A WebGPU error was not captured:", event.error.message); reportErrorToServer({ type: event.error.constructor.name, message: event.error.message, });});// …
Specifications
Specification |
---|
WebGPU> # gpuuncapturederrorevent> |
Browser compatibility
Loading…