Permalink
Browse files

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.
  • Loading branch information...
1 parent fc65423 commit 23dd325bdf9714bc4f2f804d30104d2d2a3ae595 @retronym retronym committed Apr 12, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 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
*/

0 comments on commit 23dd325

Please sign in to comment.