Recovering futures in case of error in web app

Fixes https://github.com/alexarchambault/coursier/issues/3
This commit is contained in:
Alexandre Archambault
2015-06-18 18:52:26 +02:00
parent 08349d129a
commit 754ffcbd38
@@ -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)