From 182e6947c6bd27cf66e435292df2858609139782 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Wed, 14 Dec 2011 13:51:55 -0500 Subject: Improved error output. * One SHA resolve, now outputs lots of stack traces if parallel execution failure. --- project/ShaResolve.scala | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'project') 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) -- cgit v1.2.3