summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2011-12-14 13:51:55 -0500
committerJosh Suereth <joshua.suereth@gmail.com>2011-12-14 13:51:55 -0500
commit182e6947c6bd27cf66e435292df2858609139782 (patch)
tree64e8e146854c7a8fcc9729dfbef5f2ddcac8cb4f /project
parent3ea73554823ad3f64f5d71bc08f8b9d71e67d78c (diff)
downloadscala-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')
-rw-r--r--project/ShaResolve.scala11
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)