Commit | Line | Data |
---|---|---|
e7accadb JB |
1 | export default class BaseError extends Error { |
2 | public constructor(message?: string) { | |
3 | super(message); | |
4 | this.name = new.target.name; | |
5 | Object.setPrototypeOf(this, new.target.prototype); | |
6 | Error.captureStackTrace ? (Error.captureStackTrace(this, this.constructor)) : (this.stack = (new Error()).stack); | |
7 | } | |
8 | } |