No longer expect a ValidationError to be an Error instance
This commit is contained in:
parent
29d1ed20a8
commit
a0231a7fc3
|
@ -40,7 +40,7 @@ module.exports.compose = function composeValidators(validators) {
|
|||
} else {
|
||||
throw new Error(`The 'errors' in a validationResult must be an array`);
|
||||
}
|
||||
} else if (result instanceof Error && matchValidationError(result)) {
|
||||
} else if (result != null && matchValidationError(result)) {
|
||||
return {
|
||||
errors: [ result ],
|
||||
newValue: undefined
|
||||
|
|
Loading…
Reference in a new issue