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 <
[email protected]> 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.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to