Added a proper error message for a missing library

This commit is contained in:
Šesták Vít
2017-06-28 09:15:55 +02:00
parent ffabc8a4e5
commit 420a765dc4
2 changed files with 9 additions and 4 deletions

View File

@@ -318,10 +318,10 @@ class Statistics @Inject()(
val (lastRefreshTime, resultsFuture) = projectReportsProvider.resultsForVersions(versions)
resultsFuture flatMap { allResults =>
select(allResults, selectorOption).fold(Future.successful(notFound())) { selection =>
Future.successful(Ok(views.html.library(
dep = selection.result.groupedDependenciesByHashes(depId),
selectorOption = selectorOption
)))
Future.successful(selection.result.groupedDependenciesByHashes.get(depId) match {
case None => NotFound(views.html.libraryNotFound(depId = depId, selectorOption = selectorOption))
case Some(dep) => Ok(views.html.library(dep = dep, selectorOption = selectorOption))
})
}
}
}