throwExceptionIfNeeded static method
Throws ValidationException based on errors in validation results. If validation results have no errors, than no exception is thrown.
correlationId
(optional) transaction id to trace execution through call chain.results
list of validation results that may contain errorsstrict
true to treat warnings as errors.
See ValidationResult See ValidationException
Implementation
static void throwExceptionIfNeeded(
String? correlationId, List<ValidationResult> results, bool strict) {
var ex = ValidationException.fromResults(correlationId, results, strict);
if (ex != null) throw ex;
}