nowjs-core
Version:
NowCanDo Javascript Core [nowjs-core] is a library written by TypeScript code maintains under Apache 2.0 licence
31 lines (30 loc) • 802 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class ErrorBase extends Error {
constructor(message, innerError) {
super(message);
this.innerError = innerError;
this.name = 'Error';
}
get Message() {
return this.message;
}
get Stack() {
return this.stack;
}
get InnerError() {
return this.innerError;
}
toJSON() {
const res = {};
res.Message = this.Message;
return JSON.stringify(res);
}
toString() {
if (this.innerError) {
return `Message = ${this.message} , Stack = ${this.stack} , InnerError = ${this.innerError} .`;
}
return `Message = ${this.message} , Stack = ${this.stack}`;
}
}
exports.ErrorBase = ErrorBase;