You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Native JS errors don't have its properties enumerable. What this means is that the name, stack and message properties do not appear when console.logging errors.
Notice the name and message property appearing below.
Description
Native JS errors don't have its properties enumerable. What this means is that the
name
,stack
andmessage
properties do not appear when console.logging errors.Notice the
name
andmessage
property appearing below.Proposal
To get deserialized errors closer to the native ones, when deserializing the error, we could use
Object.defineProperty
instead of a direct assignment to make the properties not enumerable. eg: here https://github.com/sindresorhus/serialize-error/blob/master/index.js#L54I'm happy to make a PR if you agree with the proposal!
Thanks for your awesome work across the Node community ❤️
The text was updated successfully, but these errors were encountered: