Package: org.codehaus.groovy.control

## [Java] Class CompilationFailedException

- org.codehaus.groovy.control.CompilationFailedException

-     public class CompilationFailedException
      extends GroovyRuntimeException

  Thrown when compilation fails from source errors.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected int` | `phase` | Compilation phase in which the failure occurred.
    `protected ProcessingUnit` | `unit` | Processing unit that reported the failure.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `CompilationFailedException(int phase, ProcessingUnit unit, Throwable cause)` Creates a compilation failure with an underlying cause.
    `CompilationFailedException(int phase, ProcessingUnit unit)` Creates a compilation failure without an underlying cause.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public ProcessingUnit` | `getUnit()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyRuntimeException` | `getLocationText, getMessage, getMessageWithoutLocationText, getModule, getNode, setModule`

- - ### Field Detail

    - #### protected int phase

      Compilation phase in which the failure occurred.

    - #### protected ProcessingUnit unit

      Processing unit that reported the failure.

  - ### Constructor Detail

    - #### public CompilationFailedException(int phase, ProcessingUnit unit, Throwable cause)

      Creates a compilation failure with an underlying cause.

      Parameters:
        `phase` - the phase in which the failure occurred
        `unit` - the processing unit that failed
        `cause` - the underlying cause

    - #### public CompilationFailedException(int phase, ProcessingUnit unit)

      Creates a compilation failure without an underlying cause.

      Parameters:
        `phase` - the phase in which the failure occurred
        `unit` - the processing unit that failed

  - ### Method Detail

    - #### public ProcessingUnit getUnit()