No longer expect a ValidationError to be an Error instance

This commit is contained in:
Sven Slootweg 2020-07-20 22:15:38 +02:00
parent 29d1ed20a8
commit a0231a7fc3

View file

@ -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