Package groovy.lang

# Class IncorrectClosureArgumentsException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
groovy.lang.GroovyRuntimeException
groovy.lang.IncorrectClosureArgumentsException

All Implemented Interfaces:
  `Serializable`

public class IncorrectClosureArgumentsException extends GroovyRuntimeException
An exception occurred when invoking a Closure with the wrong number and/or types of arguments

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IncorrectClosureArgumentsException(Closure closure, Object arguments, Class[] expected)`
  Creates an exception describing mismatched closure arguments.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getArguments()`
  Returns the supplied arguments.
  `Closure`
  `getClosure()`
  Returns the target closure.
  `Class[]`
  `getExpected()`
  Returns the expected parameter types.

  ### Methods inherited from class groovy.lang.GroovyRuntimeException

  `getLocationText, getMessage, getMessageWithoutLocationText, getModule, getNode, setModule`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### IncorrectClosureArgumentsException

    public IncorrectClosureArgumentsException(Closure closure, Object arguments, Class[] expected)
    Creates an exception describing mismatched closure arguments.
    Parameters:
      `closure` - the target closure
      `arguments` - the supplied arguments
      `expected` - the expected parameter types

- ## Method Details

  - ### getArguments

    public Object getArguments()
    Returns the supplied arguments.
    Returns:
      the supplied arguments

  - ### getClosure

    public Closure getClosure()
    Returns the target closure.
    Returns:
      the target closure

  - ### getExpected

    public Class[] getExpected()
    Returns the expected parameter types.
    Returns:
      the expected parameter types