From 23dd325bdf9714bc4f2f804d30104d2d2a3ae595 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 12 Apr 2013 08:37:51 +0200 Subject: 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. --- src/compiler/scala/tools/nsc/Global.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 */ -- cgit v1.2.3