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) • 867 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("./index");
class ValidationException extends index_1.Exception {
constructor(field, message, innerError) {
super(message, innerError);
this.name = 'ValidationException';
this.field = field;
}
get Field() {
return this.field;
}
toJSON() {
const res = {};
res.Message = this.Message;
res.Field = this.Field;
return JSON.stringify(res);
}
toString() {
if (this.InnerError) {
return `Field = ${this.field} , Message = ${this.message} , Stack = ${this.stack} , InnerError = ${this.InnerError} .`;
}
return `Field = ${this.field} , Message = ${this.message} , Stack = ${this.stack}`;
}
}
exports.ValidationException = ValidationException;