Andrea Giammarchi (2013-07-10T23:06:47.000Z)
yep, I thought it was about having meaningful red errors with a proper name
in console. The stack can be addressed passing the `new CustomError
(new Error('message'))`
using error as argument, not big deal ... abusing __proto__ for this seems
like the wrong answer to a concrete problem


On Wed, Jul 10, 2013 at 2:53 PM, François REMY <
francois.remy.dev at outlook.com> wrote:

> > ```javascript
> > function CustomError(message) {
> >    this.message = message || '';
> > }
> > CustomError.prototype = new Error;
> >
> > // whenever you need
> > throw new CustomError;
> > ```
>
> At best, this will not preserve the stack trace property, at worse this
> will lead to a bad one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130710/140ac63b/attachment.html>
domenic at domenicdenicola.com (2013-07-13T00:59:18.174Z)
yep, I thought it was about having meaningful red errors with a proper name
in console. The stack can be addressed passing the `new CustomError(new Error('message'))`
using error as argument, not big deal ... abusing `__proto__` for this seems
like the wrong answer to a concrete problem