arrow-orm
Version:
API Builder ORM
36 lines (30 loc) • 869 B
JavaScript
/**
* @class APIBuilder.ORMError
* JavaScript Error object that will capture a stack trace.
*/
/**
* @param {string} message - Error message.
*/
function ORMError(message) {
this.message = message;
Error.captureStackTrace(this, ORMError);
}
ORMError.prototype = Object.create(Error.prototype);
ORMError.prototype.constructor = ORMError;
/**
* @class APIBuilder.ValidationError
* JavaScript Error object that will capture a stack trace.
*/
/**
* Constructor.
* @param {string} field Field name that failed validation.
* @param {string} message Error message.
*/
function ValidationError(field, message) {
this.field = field;
ORMError.call(this, message);
}
ValidationError.prototype = Object.create(ORMError.prototype);
ValidationError.prototype.constructor = ValidationError;
exports.ValidationError = ValidationError;
exports.ORMError = ORMError;