# Class TaskExecutionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.gradle.api.GradleException
org.gradle.internal.exceptions.DefaultMultiCauseException
org.gradle.api.tasks.TaskExecutionException

All Implemented Interfaces:
  `Serializable, org.gradle.internal.exceptions.MultiCauseException, org.gradle.internal.exceptions.NonGradleCauseExceptionsHolder, org.gradle.internal.exceptions.ResolutionProvider`

public class TaskExecutionException extends org.gradle.internal.exceptions.DefaultMultiCauseException
A `TaskExecutionException` is thrown when a task fails to execute successfully.

If the cause of a failure is a `VerificationException`, we should not display task provenance information on the console in the failure message.

Since:
  0.9
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TaskExecutionException(Task task, Throwable cause)`
  Creates a new `TaskExecutionException`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Task`
  `getTask()`
  Returns the task.

  ### Methods inherited from class org.gradle.internal.exceptions.DefaultMultiCauseException

  `getCause, getCauses, getMessage, getResolutions, hasCause, initCause, initCauses, printStackTrace, printStackTrace`

  ### Methods inherited from class Throwable

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

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### TaskExecutionException

    public TaskExecutionException(Task task, Throwable cause)
    Creates a new `TaskExecutionException`.
    Since:
      0.9

- ## Method Details

  - ### getTask

    public Task getTask()
    Returns the task.
    Since:
      0.9