From 9382d7ca14d65660b9589a7172c226bc00bd851c Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 26 Nov 2010 03:54:19 +0000 Subject: 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. --- src/compiler/scala/tools/nsc/ObjectRunner.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/compiler/scala/tools/nsc/ObjectRunner.scala') 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)) } } } -- cgit v1.2.3