Home >> Tutorials >> Node.js Error Object - Error Handling
Previous Page

Node Inspect

Node.js Error Handling

How to handle errors using Error Object in Node.js?

An error object is an object that is either an instance of the Error, or extends the Error class.

throw new Error('Ran out of coffee')

You can extends Error class like below:

class NotFoundError extends Error {
  //...
}
throw new NotFoundError
Previous Page

Node Inspect

Full Stack Tutorials

Author @FullStackTutorials | View all Articles