Back to Developer Roadmap

User Specified Errors

src/data/roadmaps/nodejs/content/user-specified-errors@wQ4i6_a1EFk9HHc6Sll-3.md

4.0594 B
Original Source

User Specified Errors

User specified errors can be created by extending the base Error object, a built-in error class. When creating errors in this manner, you should pass a message string that describes the error. This message can be accessed through the message property on the object. The Error object also contains a name and a stack property that indicate the name of the error and the point in the code at which it is created.

Visit the following resources to learn more: