Log metadata fetching from js

Lost in refactoring
This commit is contained in:
Alexandre Archambault 2015-06-26 13:42:19 +02:00
parent e5df5f6a1b
commit 4e0094f12d
1 changed files with 10 additions and 4 deletions

View File

@ -84,13 +84,19 @@ case class Fetch(root: String,
def apply(artifact: Artifact,
cachePolicy: Repository.CachePolicy): EitherT[Task, String, String] = {
val url0 = root + artifact.url
EitherT(
Task { implicit ec =>
Fetch.get(root + artifact.url)
.map(\/-(_))
.recover{case e: Exception => -\/(e.getMessage)}
Future(logger.foreach(_.fetching(url0)))
.flatMap(_ => Fetch.get(url0))
.map{ s => logger.foreach(_.fetched(url0)); \/-(s) }
.recover{case e: Exception =>
logger.foreach(_.other(url0, e.getMessage))
-\/(e.getMessage)
}
}
)
}
}
}