diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2011-12-14 13:51:55 -0500 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2011-12-14 13:51:55 -0500 |
commit | 182e6947c6bd27cf66e435292df2858609139782 (patch) | |
tree | 64e8e146854c7a8fcc9729dfbef5f2ddcac8cb4f /project/ShaResolve.scala | |
parent | 3ea73554823ad3f64f5d71bc08f8b9d71e67d78c (diff) | |
download | scala-182e6947c6bd27cf66e435292df2858609139782.tar.gz scala-182e6947c6bd27cf66e435292df2858609139782.tar.bz2 scala-182e6947c6bd27cf66e435292df2858609139782.zip |
Improved error output.
* One SHA resolve, now outputs lots of stack traces if parallel execution failure.
Diffstat (limited to 'project/ShaResolve.scala')
-rw-r--r-- | project/ShaResolve.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/project/ShaResolve.scala b/project/ShaResolve.scala index c6034bbf01..82139ee591 100644 --- a/project/ShaResolve.scala +++ b/project/ShaResolve.scala @@ -4,7 +4,7 @@ import Build._ import Keys._ import Project.Initialize import scala.collection.{ mutable, immutable } - +import scala.collection.parallel.CompositeThrowable @@ -22,7 +22,7 @@ object ShaResolve { pullBinaryLibs in ThisBuild <<= (baseDirectory, binaryLibCache, streams) map resolveLibs ) - def resolveLibs(dir: File, cacheDir: File, s: TaskStreams): Unit = { + def resolveLibs(dir: File, cacheDir: File, s: TaskStreams): Unit = loggingParallelExceptions(s) { val files = (dir / "test" / "files" ** "*.desired.sha1") +++ (dir / "lib" ** "*.desired.sha1") for { (file, name) <- (files x relativeTo(dir)).par @@ -33,6 +33,13 @@ object ShaResolve { } pullFile(jar, sha + "/" + uri, cacheDir, s) } + @inline final def loggingParallelExceptions[U](s: TaskStreams)(f: => U): U = try f catch { + case t: CompositeThrowable => + s.log.error("Error during parallel execution, GET READ FOR STACK TRACES!!") + t.throwables foreach (t2 => s.log.trace(t2)) + throw t + } + def getShaFromShafile(file: File): String = (IO read file split "\\s" headOption) getOrElse error("No SHA found for " + file) |