No longer expect a ValidationError to be an Error instance

parse-stacktrace-fix
Sven Slootweg 4 years ago
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…
Cancel
Save