diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2006-08-21 10:24:57 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2006-08-21 10:24:57 +0000 |
commit | 5a90f0aebdaab1bea251887c70a615181b03b885 (patch) | |
tree | 4bebf8c84e609f0b3c72a972f11aef444eb3d355 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala | |
parent | ad4905c0ff97620a55d3be7790363ab44e2e4b67 (diff) | |
download | scala-5a90f0aebdaab1bea251887c70a615181b03b885.tar.gz scala-5a90f0aebdaab1bea251887c70a615181b03b885.tar.bz2 scala-5a90f0aebdaab1bea251887c70a615181b03b885.zip |
Enhanced error reporting to not eat stack trace.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 22d792bc4f..b1a4b74133 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -178,6 +178,14 @@ trait Contexts requires Analyzer { c } + def error(pos : Int, er : Error): Unit = { + val msg = er.getMessage(); + if (reportGeneralErrors) + unit.error(pos, if (checking) "**** ERROR DURING INTERNAL CHECKING ****\n" + msg else msg) + else + throw er; + } + def error(pos: int, msg: String): unit = if (reportGeneralErrors) unit.error(pos, if (checking) "**** ERROR DURING INTERNAL CHECKING ****\n" + msg else msg) |