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