diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2011-07-15 09:54:22 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2011-07-15 09:54:22 +0000 |
commit | 59e9ddb7fdb4a6d5f92b3cf3cb7cc4c015730a3d (patch) | |
tree | d001b53e056f440bd9d6eef000deb6595e042c63 | |
parent | e1c118efaf84826c3492060f79be25a0b9a78661 (diff) | |
download | scala-59e9ddb7fdb4a6d5f92b3cf3cb7cc4c015730a3d.tar.gz scala-59e9ddb7fdb4a6d5f92b3cf3cb7cc4c015730a3d.tar.bz2 scala-59e9ddb7fdb4a6d5f92b3cf3cb7cc4c015730a3d.zip |
Merged revisions 24689 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r24689 | dragos | 2011-04-05 18:19:45 +0200 (Tue, 05 Apr 2011) | 3 lines
Wrapped exceptions coming from calls to 'ask' in a FailedException.
This allows to get a stack trace from both the presentation compiler
thread and the calling thread. review by odersky. ........
-rw-r--r-- | src/compiler/scala/tools/nsc/util/InterruptReq.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/util/InterruptReq.scala b/src/compiler/scala/tools/nsc/util/InterruptReq.scala index e7c05beb65..8c1ce02e06 100644 --- a/src/compiler/scala/tools/nsc/util/InterruptReq.scala +++ b/src/compiler/scala/tools/nsc/util/InterruptReq.scala @@ -1,6 +1,8 @@ package scala.tools.nsc package util +import interactive.AskException + /** A class of work items to be used in interrupt requests. */ abstract class InterruptReq { @@ -24,12 +26,14 @@ abstract class InterruptReq { notify() } - /** To be called from interrupting client to get result fo interrupt */ + /** To be called from interrupting client to get result for interrupt */ def getResult(): R = synchronized { while (result.isEmpty) wait() result.get match { case Left(res) => res - case Right(t) => throw t + case Right(t) => throw new FailedInterrupt(t) } } } + +class FailedInterrupt(cause: Throwable) extends Exception("Compiler exception during call to 'ask'", cause) |