diff options
author | Paul Phillips <paulp@improving.org> | 2010-11-26 03:54:19 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-11-26 03:54:19 +0000 |
commit | 9382d7ca14d65660b9589a7172c226bc00bd851c (patch) | |
tree | 840408e7274c07da6a8c337c6c50beb6f1d20764 /src/compiler/scala/tools/nsc/ObjectRunner.scala | |
parent | a16bba97a013cc7cb8bb7fa8815b4683efa4324a (diff) | |
download | scala-9382d7ca14d65660b9589a7172c226bc00bd851c.tar.gz scala-9382d7ca14d65660b9589a7172c226bc00bd851c.tar.bz2 scala-9382d7ca14d65660b9589a7172c226bc00bd851c.zip |
In the absence of known reasons why some except...
In the absence of known reasons why some exceptions are intercepted or
have their stack trace printed and others fly unchallenged, changed
script and object runners to handle everything consistently when an
exception is thrown. Closes #3978 again, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ObjectRunner.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ObjectRunner.scala | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ObjectRunner.scala b/src/compiler/scala/tools/nsc/ObjectRunner.scala index 987a6b0ba0..16793996bb 100644 --- a/src/compiler/scala/tools/nsc/ObjectRunner.scala +++ b/src/compiler/scala/tools/nsc/ObjectRunner.scala @@ -9,6 +9,7 @@ package scala.tools.nsc import java.net.URL import util.ScalaClassLoader import java.lang.reflect.InvocationTargetException +import util.Exceptional.unwrap /** An object that runs another object specified by name. * @@ -37,10 +38,6 @@ object ObjectRunner { */ def runAndCatch(urls: List[URL], objectName: String, arguments: Seq[String]): Either[Throwable, Unit] = { try Right(run(urls, objectName, arguments)) - catch { - case e: ClassNotFoundException => Left(e) - case e: NoSuchMethodException => Left(e) - case e: InvocationTargetException => Left(e.getCause match { case null => e ; case cause => cause }) - } + catch { case e => Left(unwrap(e)) } } } |