in app/services/GithubAPI.scala [136:150]
private def listArtifacts(artifactsUrl:Uri):Future[Either[circe.Error, Seq[GitHubArtifact]]] = {
getHttp
.singleRequest(HttpRequest(uri=artifactsUrl, headers=Seq(defaultGithubHeaders)))
.flatMap(response=>{
(response.status: @switch) match {
case StatusCodes.OK=>
unmarshalContent[GitHubArtifactsResponse](consumeResponseContent(response)).map(_.map(_.artifacts))
case _=>
consumeResponseContent(response).flatMap(content=> {
logger.error(s"Could not get artifacts zip, server returned ${response.status} ${content.utf8String}")
Future.failed(new RuntimeException("External server error"))
})
}
})
}