# Class InvalidActionClosureException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.gradle.api.GradleException
org.gradle.api.InvalidActionClosureException

All Implemented Interfaces:
  `Serializable`

public class InvalidActionClosureException extends GradleException
Thrown when a `Closure` is given as an `Action` implementation, but has the wrong signature.

Since:
  1.3
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InvalidActionClosureException(Closure<?> closure, Object argument)`
  Creates a new `InvalidActionClosureException`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getArgument()`
  The argument the action was executed with.
  `Closure<?>`
  `getClosure()`
  The closure being used as an action.

  ### Methods inherited from class Throwable

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

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### InvalidActionClosureException

    public InvalidActionClosureException(Closure<?> closure, Object argument)
    Creates a new `InvalidActionClosureException`.
    Since:
      1.3

- ## Method Details

  - ### getClosure

    public Closure<?> getClosure()
    The closure being used as an action.
    Returns:
      The closure being used as an action.
    Since:
      1.3

  - ### getArgument

    public Object getArgument()
    The argument the action was executed with.
    Returns:
      The argument the action was executed with.
    Since:
      1.3