diff options
author | Andreu Botella <andreu@andreubotella.com> | 2022-03-14 19:35:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 19:35:15 +0100 |
commit | c6bf07ec6d231d29149a2454d3b5135a41c6cbab (patch) | |
tree | e9252ea7bfba740802826ef26124393f3e0642de /ext/web/02_structured_clone.js | |
parent | b4e42953e1d243f2eda20e5be6b845d60b7bf688 (diff) |
fix(core): Don't override structured clone error messages from V8 (#13942)
In the implementation of structured serialization in
`Deno.core.serialize`, whenever there is a serialization error, an
exception will be thrown with the message "Failed to serialize
response", even though V8 provides a message to use in such cases.
This change instead throws an exception with the V8-provided message,
if there is one.
Diffstat (limited to 'ext/web/02_structured_clone.js')
-rw-r--r-- | ext/web/02_structured_clone.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/web/02_structured_clone.js b/ext/web/02_structured_clone.js index 058390cfe..62bb48ebd 100644 --- a/ext/web/02_structured_clone.js +++ b/ext/web/02_structured_clone.js @@ -77,7 +77,7 @@ return core.deserialize(core.serialize(value)); } catch (e) { if (ObjectPrototypeIsPrototypeOf(TypeErrorPrototype, e)) { - throw new DOMException("Uncloneable value", "DataCloneError"); + throw new DOMException(e.message, "DataCloneError"); } throw e; } |