Hacker News new | past | comments | ask | show | jobs | submit login

Well, in that case you'd lose the stack trace. If you just set the object's prototype to Error.prototype, and you add additional properties to the object's prototype you'd be modifying the Error's prototype as well.

The aim of this helper is to create a custom object which has the same functionality as a traditional Error object.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: