mirror of
https://github.com/sbt/sbt.git
synced 2026-09-04 08:45:56 +02:00
Recovering futures in case of error in web app
Fixes https://github.com/alexarchambault/coursier/issues/3
This commit is contained in:
@@ -100,7 +100,7 @@ case class Remote(base: String, logger: Option[Logger] = None) extends Repositor
|
||||
|
||||
EitherT(Task{ implicit ec =>
|
||||
logger.foreach(_.fetching(url))
|
||||
Remote.get(url).map{ eitherXml =>
|
||||
Remote.get(url).recover{case e: Exception => Left(e.getMessage)}.map{ eitherXml =>
|
||||
logger.foreach(_.fetched(url))
|
||||
for {
|
||||
xml <- \/.fromEither(eitherXml)
|
||||
|
||||
Reference in New Issue
Block a user