in app/controllers/ProjectsController.scala [185:199]
def branchesForProject(projectId:String) = IsAdminAsync { uid=> req=>
withVCSAPI(projectId) { vcs =>
vcs.branchesForProject(projectId.toString).map({
case Right(branches) =>
Ok(branches.sortBy(_.commit.committed_date).asJson)
case Left(err) =>
logger.error(s"could not retrieve branches for project id $projectId: ${err.toString}")
InternalServerError(GenericErrorResponse("error", s"gitlab api problem: ${err.toString}").asJson)
}).recover({
case err: Throwable =>
logger.error(s"Get branches operation threw an exception: ${err.getMessage}", err)
InternalServerError(GenericErrorResponse("internal_error", "An unexpected exception was thrown, see server logs for details").asJson)
})
}
}