Opal-Estate-Pro/node_modules/error/validation.js

20 lines
380 B
JavaScript
Raw Normal View History

2019-09-13 06:27:52 +02:00
module.exports = ValidationError
function ValidationError(errors) {
var result = new Error()
Object.defineProperty(result, "type", {
value: result.type,
enumerable: true,
writable: true,
configurable: true
})
result.errors = errors
result.message = errors[0].message
result.type = "ValidationError"
return result
}