Don't override structured clone error messages from V8
fix(core): Don't override structured clone error messages from V8 (#13942)
Don't override structured clone error messages from V8fixdon override structured clone error messages
Committed by andreubotella
commit message
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.Editor assessment
The subject states the correction - V8's own structured-clone error messages are no longer overridden - and the body explains the mechanism precisely: serialization failures in Deno.core.serialize threw a generic Failed to serialize response even when V8 provided a specific message, and the change surfaces that message when present. That is a real explanation of behavior before and after, not restatement. Clean hygiene and accurate scope make this a strong publishable fix. The generic-versus-V8-provided message contrast is the substance, and the body presents it with just enough implementation detail.