mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-19 07:44:44 +01:00
E-mail export: More descriptive error message when some vulnerability is missing
This commit is contained in:
@@ -79,7 +79,7 @@ class EmailExportService(from: String, nobodyInterestedContact: String, val expo
|
|||||||
def emailDigest(subscriber: LoginInfo, changes: Seq[Change], projects: ProjectsWithReports): Future[Email] = {
|
def emailDigest(subscriber: LoginInfo, changes: Seq[Change], projects: ProjectsWithReports): Future[Email] = {
|
||||||
val vulnNames = changes.map(_.vulnerabilityName).toSet
|
val vulnNames = changes.map(_.vulnerabilityName).toSet
|
||||||
for {
|
for {
|
||||||
vulns <- Future.traverse(vulnNames.toSeq)(name => odcService.getVulnerabilityDetails(name).map(v => name -> v.get)).map(_.toMap)
|
vulns <- Future.traverse(vulnNames.toSeq)(name => odcService.getVulnerabilityDetails(name).map(v => name -> v.getOrElse(throw new NoSuchElementException(s"Vulnerability details for '$name' not found.")))).map(_.toMap)
|
||||||
groups = changes.groupBy(_.direction).withDefaultValue(Seq())
|
groups = changes.groupBy(_.direction).withDefaultValue(Seq())
|
||||||
} yield {
|
} yield {
|
||||||
val changesMarks = Map(Direction.Added -> "❢", Direction.Removed -> "☑")
|
val changesMarks = Map(Direction.Added -> "❢", Direction.Removed -> "☑")
|
||||||
|
|||||||
Reference in New Issue
Block a user