From c6bf07ec6d231d29149a2454d3b5135a41c6cbab Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 14 Mar 2022 19:35:15 +0100 Subject: 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. --- ext/web/02_structured_clone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/web/02_structured_clone.js') 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; } -- cgit v1.2.3