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 {
|
} else {
|
||||||
throw new Error(`The 'errors' in a validationResult must be an array`);
|
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 {
|
return {
|
||||||
errors: [ result ],
|
errors: [ result ],
|
||||||
newValue: undefined
|
newValue: undefined
|
||||||
|
|
Loading…
Reference in a new issue