validateOrThrow method
- dynamic value
Works the same as validate, validates that a given value is valid, but throws instead if it's not.
Implementation
Result validateOrThrow(dynamic value) {
final result = validate(value);
if (result.isNotValid) throw ValidatorFailedException(result);
return result;
}