Custom Errors in ES6 (ES2015)
A very quick note. With the new class
and extend
keywords it’s now much easier to subclass Error
constructor:
There is no need for this.stack = (new Error()).stack;
trick thanks to super()
call.
A very quick note. With the new class
and extend
keywords it’s now much easier to subclass Error
constructor:
There is no need for this.stack = (new Error()).stack;
trick thanks to super()
call.