mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-27 11:31:47 +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)
|
val (lastRefreshTime, resultsFuture) = projectReportsProvider.resultsForVersions(versions)
|
||||||
resultsFuture flatMap { allResults =>
|
resultsFuture flatMap { allResults =>
|
||||||
select(allResults, selectorOption).fold(Future.successful(notFound())) { selection =>
|
select(allResults, selectorOption).fold(Future.successful(notFound())) { selection =>
|
||||||
Future.successful(Ok(views.html.library(
|
Future.successful(selection.result.groupedDependenciesByHashes.get(depId) match {
|
||||||
dep = selection.result.groupedDependenciesByHashes(depId),
|
case None => NotFound(views.html.libraryNotFound(depId = depId, selectorOption = selectorOption))
|
||||||
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