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.
Loading...
Related Quiz
- In a sharded database architecture, how are Update operations handled across multiple shards?
- Which of the following is the correct way to declare a variable in JavaScript?
- How can you prevent a specific package from being updated when running npm update?
- To handle uncaught exceptions in a Node.js application, you can use process.on('______', callback).
- When the Event Loop encounters an asynchronous task, it offloads it to the ________ and continues to execute subsequent tasks.