Unverified Commit de9d5ff2 authored by Anna Henningsen's avatar Anna Henningsen
Browse files

worker: use correct ctor for error serialization

When serializing errors, use the error constructor that is
closest to the object itself in the prototype chain.

The previous practice of walking downwards meant that
`Error` would usually be the first constructor that is used,
even when a more specific one would be available/appropriate,
because it is the base class of the other common error types.

PR-URL: https://github.com/nodejs/node/pull/25951


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: default avatarMinwoo Jung <minwoo@nodesource.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent 8b79c15b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment