Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties throws RangeError: Invalid time value when the error object has field of type Date with value Invalid Date #17

Open
nedyalkov opened this issue Apr 5, 2021 · 0 comments

Comments

@nedyalkov
Copy link

If you call the properties method on an error object that has a field of type Date with a value Invalid Date, it tries to call the toISOString method of this object and throws an error: RangeError: Invalid time value.

To reproduce this, do the following:

var stackman = require('stackman')()

var err = new Error('Oops!')
err.number = Number.NaN;
err.date = new Date('invalid')

var props = stackman.properties(err)
console.log(props)

If you comment out err.date = new Date('invalid') or change the value to a valid date, the code works.

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

No branches or pull requests

1 participant