Im working at big project using TypeScript. Now I create error classes using standard Error
class as superclass. But there are lots of similar code in every derived class:
class AddonError extends Error {
constructor(message:string) {
super(message);
this.message = message;
this.stack = (new Error()).stack;
}
readonly message:string;
readonly stack:string|undefined;
}
Is it right way to create error superclass with this code? I doubt because of extending and one more import
directive...