Skip to content

fix(core): Don't override structured clone error messages from V8#13942

Merged
bartlomieju merged 3 commits intodenoland:mainfrom
andreubotella:data-clone-error-correct-message
Mar 14, 2022
Merged

fix(core): Don't override structured clone error messages from V8#13942
bartlomieju merged 3 commits intodenoland:mainfrom
andreubotella:data-clone-error-correct-message

Conversation

@andreubotella
Copy link
Contributor

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.

Closes #13932.

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.

Closes denoland#13932.
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good fix, thank Andreu!

@bartlomieju bartlomieju merged commit c6bf07e into denoland:main Mar 14, 2022
@andreubotella andreubotella deleted the data-clone-error-correct-message branch March 14, 2022 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structured clone serialization errors have the wrong message

2 participants