summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-04-12 08:37:51 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-04-12 08:37:51 +0200
commit23dd325bdf9714bc4f2f804d30104d2d2a3ae595 (patch)
tree4972374520e9dea618102730a7c8e6769a3d7853 /src/compiler/scala/tools/nsc/Global.scala
parentfc65423d8d6a7548393d212e17c8563cf40bcfc0 (diff)
downloadscala-23dd325bdf9714bc4f2f804d30104d2d2a3ae595.tar.gz
scala-23dd325bdf9714bc4f2f804d30104d2d2a3ae595.tar.bz2
scala-23dd325bdf9714bc4f2f804d30104d2d2a3ae595.zip
SI-7360 Don't let a follow-up TypeError obscure the original error.
When supplementing a fatal error message with context (current compilation unit, tree, phase, etcetera), we must be cautious to not to trigger another error which will obscure the original one. Currently, `supplementErrorMessage` does its working a try catch that only catches `Exception`. But this fails to catch CyclicReferenceError (<: TypeError <: Throwable), as was seen in a recent mailing list post by Greg Meredith. This commit extends the catch clause.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 7a67ac6246..aea3e0d930 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -1180,7 +1180,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
("\n" + info1) :: info2 :: info3 mkString "\n\n"
}
- catch { case x: Exception => errorMessage }
+ catch { case _: Exception | _: TypeError => errorMessage }
/** The id of the currently active run
*/