validateAndThrowException method

void validateAndThrowException(
  1. String? correlationId,
  2. dynamic value, [
  3. bool strict = false
])

Validates the given value and throws a ValidationException if errors were found.

  • correlationId (optional) transaction id to trace execution through call chain.
  • value a value to be validated.
  • strict true to treat warnings as errors.

See ValidationException.throwExceptionIfNeeded

Implementation

void validateAndThrowException(String? correlationId, dynamic value,
    [bool strict = false]) {
  var results = validate(value);
  ValidationException.throwExceptionIfNeeded(correlationId, results, strict);
}