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 17:52:26 +01:00
parent 08349d129a
commit 754ffcbd38
1 changed files with 1 additions and 1 deletions

View File

@ -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)