Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
export class BaseError extends Error {
export class BaseError extends Error {
public constructor (message?: string) {
super(message)
this.name = new.target.name
public constructor (message?: string) {
super(message)
this.name = new.target.name
Object.setPrototypeOf(this, new.target.prototype)
Object.setPrototypeOf(this, new.target.prototype)
- if (this.stack == null && typeof BaseError.captureStackTrace === 'function') {
- BaseError.captureStackTrace(this, this.constructor)
+ if (typeof Error.captureStackTrace === 'function') {
+ Error.captureStackTrace(this, BaseError)