Package org.codehaus.groovy.tools
Class ErrorReporter
java.lang.Object
org.codehaus.groovy.tools.ErrorReporter
Provides services for reporting compilation errors to the
user. Primary entry point is
write()
.-
Constructor Summary
ConstructorDescriptionConfigures a new Reporter.ErrorReporter
(Throwable e, boolean debug) Configures a new Reporter. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Runs the report once all initialization is complete.protected void
Prints a line to the underlyingPrintStream
protected void
println
(StringBuffer line) protected void
For Exception.protected void
For everything else.protected void
report
(CompilationFailedException e, boolean child) For CompilationFailedException.protected void
report
(GroovyExceptionInterface e, boolean child) For GroovyException.protected void
stacktrace
(Throwable e, boolean always) Displays an exception's stack trace, ifdebug
oralways
.void
write
(PrintStream stream) Writes the error to the specifiedPrintStream
.void
write
(PrintWriter writer) Writes the error to the specifiedPrintWriter
.
-
Constructor Details
-
ErrorReporter
Configures a new Reporter. Default mode is not to report a stack trace unless the error was not of one of the supported types.- Parameters:
e
- the exception on which to report
-
ErrorReporter
Configures a new Reporter.- Parameters:
e
- the exception on which to reportdebug
- if set, stack traces will be output for all reports
-
-
Method Details
-
write
Writes the error to the specifiedPrintStream
. -
write
Writes the error to the specifiedPrintWriter
. -
dispatch
Runs the report once all initialization is complete. -
report
For CompilationFailedException. -
report
For GroovyException. -
report
For Exception. -
report
For everything else. -
println
Prints a line to the underlyingPrintStream
-
println
-
stacktrace
Displays an exception's stack trace, ifdebug
oralways
.
-