Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
export class BaseError extends Error {
+ public date: Date
+
public constructor (message?: string) {
super(message)
this.name = new.target.name
+ this.date = new Date()
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)
}
}
}