← Back to release summary

Reject Worklet.addModule() with a more specific error

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 79)
Intent stage
None

Summary

When Worklet.addModule() fails, a promise rejects with a more specific error object than it did previously. Worklet.addModule() can fail for various reasons, including, for example, network errors and syntax errors. Before this change, Worklet.addModule() rejected with AbortError regardless of the actual cause. That made it difficult for developers to debug worklets. After this change, Worklet.addModule() rejects with a clearer error such as SyntaxError.

Standards & signals

Explainers: n/a

View on chromestatus.com