Package: org.codehaus.groovy.tools

## [Java] Class ErrorReporter

- org.codehaus.groovy.tools.ErrorReporter

-     public class ErrorReporter
      extends Object

  Provides services for reporting compilation errors to the user. Primary entry point is `write()`.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ErrorReporter (Throwable e)` Configures a new Reporter.
    `ErrorReporter (Throwable e, boolean debug)` Configures a new Reporter.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected void` | `dispatch(Throwable object, boolean child)` Runs the report once all initialization is complete.
    `` | `protected void` | `println(String line)` Prints a line to the underlying `PrintStream`
    `` | `protected void` | `println(StringBuffer line)`
    `` | `protected void` | `report(CompilationFailedException e, boolean child)` For CompilationFailedException.
    `` | `protected void` | `report(GroovyExceptionInterface e, boolean child)` For GroovyException.
    `` | `protected void` | `report(Exception e, boolean child)` For Exception.
    `` | `protected void` | `report(Throwable e, boolean child)` For everything else.
    `` | `protected void` | `stacktrace(Throwable e, boolean always)` Displays an exception's stack trace, if `debug` or `always`.
    `` | `public void` | `write(PrintStream stream)` Writes the error to the specified `PrintStream`.
    `` | `public void` | `write(PrintWriter writer)` Writes the error to the specified `PrintWriter`.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### public ErrorReporter(Throwable e)

      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

    - #### public ErrorReporter(Throwable e, boolean debug)

      Configures a new Reporter.

      Parameters:
        `e` - the exception on which to report
        `debug` - if set, stack traces will be output for all reports

  - ### Method Detail

    - #### protected void dispatch(Throwable object, boolean child)

      Runs the report once all initialization is complete.

    - #### protected void println(String line)

      Prints a line to the underlying `PrintStream`

    - #### protected void println(StringBuffer line)

    - #### protected void report(CompilationFailedException e, boolean child)

      For CompilationFailedException.

    - #### protected void report(GroovyExceptionInterface e, boolean child)

      For GroovyException.

    - #### protected void report(Exception e, boolean child)

      For Exception.

    - #### protected void report(Throwable e, boolean child)

      For everything else.

    - #### protected void stacktrace(Throwable e, boolean always)

      Displays an exception's stack trace, if `debug` or `always`.

    - #### public void write(PrintStream stream)

      Writes the error to the specified `PrintStream`.

    - #### public void write(PrintWriter writer)

      Writes the error to the specified `PrintWriter`.