Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.tasks
Class StopActionException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.lang.RuntimeException
                  org.gradle.api.GradleException
                      org.gradle.api.tasks.StopActionException

    class StopActionException
    extends GradleException

A `StopActionException` is be thrown by a org.gradle.api.TaskAction or task action closure to stop its own execution and to start execution of the task's next action. An action can usually be stopped by just calling return inside the action closure. But if the action works with helper methods that can lead to redundant code. For example:

         List existentSourceDirs = HelperUtil.getExistentSourceDirs()
         if (!existentSourceDirs) {return}

If the `getExistentSourceDirs()` throws a `StopActionException` instead, the tasks does not need the if statement.

Note that throwing this exception does not fail the execution of the task or the build.

author:
  Hans Dockter

Constructor Summary
`StopActionException()`
`StopActionException(java.lang.String message)`

Method Summary

Methods inherited from class java.lang.RuntimeException
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll

Methods inherited from class java.lang.Exception
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll

Methods inherited from class java.lang.Throwable
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll

Methods inherited from class java.lang.Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Constructor Detail

### StopActionException

    public StopActionException()

### StopActionException

    public StopActionException(java.lang.String message)

Groovy Documentation