in multiversion/src/main/scala/multiversion/diagnostics/MultidepsEnrichments.scala [62:77]
def reportOrElse[T](diagnostics: List[Diagnostic], result: => T): Result[T] = {
val hasError = diagnostics.exists(_.severity >= ErrorSeverity)
if (hasError) {
Diagnostic.fromDiagnostics(diagnostics) match {
case Some(diagnostic) => ErrorResult(diagnostic)
case None => ValueResult(result)
}
} else {
diagnostics.foreach(app.reporter.log)
val warnings = diagnostics.count(_.severity == WarningSeverity)
if (warnings > 0) {
app.reporter.warning(warnings + " warning(s) found.")
}
ValueResult(result)
}
}