We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was surprised I couldn't subclass errors. I would have expected my ValidationError class would support an instanceof check against itself.
instanceof
const { BadRequest } = require('http-errors') const assert = require('assert') class ValidationError extends BadRequest {} const err = new ValidationError() console.log(err.name) // "BadRequestError" // err should be an instance of ValidationError assert(err instanceof ValidationError)
https://runkit.com/cdignam-segment/6536e492c20c690008824a73
The text was updated successfully, but these errors were encountered:
duplicate of #98, but yes duly noted. I would expect this to work this way as well.
Sorry, something went wrong.
No branches or pull requests
I was surprised I couldn't subclass errors. I would have expected my ValidationError class would support an
instanceof
check against itself.https://runkit.com/cdignam-segment/6536e492c20c690008824a73
The text was updated successfully, but these errors were encountered: