throwExceptionIfNeeded method Null safety

void throwExceptionIfNeeded(
  1. String? correlationId,
  2. List<ValidationResult> results,
  3. bool strict
)

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 errors
  • strict true to treat warnings as errors.

See ValidationResult See ValidationException