Question
What is the difference between throwing a generic `Error` and a custom error?
Asked by: USER2641
77 Viewed
77 Answers
Answer (77)
A generic `Error` object provides a basic error message. A custom error allows you to define specific error types with properties relevant to your application. Custom errors are more informative and make debugging easier because they can carry additional data about the error's cause.