When creating a custom error class in Express.js, it should extend the built-in ______ class.

  • Error
  • HttpException
  • AppError
  • CustomError
When creating a custom error class in Express.js, it should extend the built-in Error class. This allows you to leverage the error handling capabilities provided by JavaScript and Express.js. Extending other classes like HttpException, AppError, or CustomError is not a standard practice for custom error classes in Express.js.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *