mirror of https://github.com/sbt/sbt.git
parent
e5df5f6a1b
commit
4e0094f12d
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue