Package: groovy.lang

## [Java] Class ClosureException

- groovy.lang.ClosureException

-     public class ClosureException
      extends RuntimeException

  An exception thrown by a closure invocation

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ClosureException(Closure closure, Throwable cause)` Creates a new closure exception.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Closure` | `getClosure()` Returns the closure that threw the exception.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class RuntimeException` | `addSuppressed, equals, fillInStackTrace, getCause, getClass, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, hashCode, initCause, notify, notifyAll, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public ClosureException(Closure closure, Throwable cause)

      Creates a new closure exception.

      Parameters:
        `closure` - the closure that failed
        `cause` - the underlying cause

  - ### Method Detail

    - #### public Closure getClosure()

      Returns the closure that threw the exception.

      Returns:
        the failing closure