mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-01-16 08:37:12 +01:00
Added a proper error message for a missing library
This commit is contained in:
@@ -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))
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
5
app/views/libraryNotFound.scala.html
Normal file
5
app/views/libraryNotFound.scala.html
Normal file
@@ -0,0 +1,5 @@
|
||||
@import com.ysoft.odc.Hashes
|
||||
@(depId: Hashes, selectorOption: Option[String])(implicit header: DefaultRequest, mainTemplateData: MainTemplateData)
|
||||
@main(title=s"Unknown library"){
|
||||
There is no library found for hashes @depId.hashTuples.map{case (hashType, hashValue) => @hashType=@hashValue}.mkString(", "). It might have been removed or updated to a newer version.
|
||||
}
|
||||
Reference in New Issue
Block a user