diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 217823d2a9..204788e74d 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -402,7 +402,16 @@ class Interpreter(val compiler: Global, output: (String => Unit)) { def loadAndRun: String = { val interpreterResultObject: Class = Class.forName(resultObjectName,true,classLoader) val resultValMethod: java.lang.reflect.Method = interpreterResultObject.getMethod("result",null) - resultValMethod.invoke(interpreterResultObject,null).toString() + try { + resultValMethod.invoke(interpreterResultObject,null).toString() + } catch { + case e => { + def caus(e: Throwable): Throwable = + if(e.getCause == null) e else caus(e.getCause) + val orig = caus(e) + stringFrom(str => orig.printStackTrace(str)) + } + } } /** return a summary of the defined methods */ |