Serializable errors
The DOMException
, Error
, EvalError
, RangeError
, ReferenceError
, SyntaxError
, TypeError
, and URIError
objects are serializable. You can call structuredClone()
on an error object or pass it to a worker using postMessage()
.