gradle
8.3

# StopActionException

open class StopActionException : GradleException

A `StopActionException` is be thrown by a task org.gradle.api.Action 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}

Content copied to clipboard

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.

## Constructors

StopActionException
Link copied to clipboard
constructor()
constructor(message: String)

## Functions

addSuppressed
Link copied to clipboard
fun addSuppressed(exception: Throwable)
fillInStackTrace
Link copied to clipboard
open fun fillInStackTrace(): Throwable
getLocalizedMessage
Link copied to clipboard
open fun getLocalizedMessage(): String
getMessage
Link copied to clipboard
open fun getMessage(): String
getSuppressed
Link copied to clipboard
fun getSuppressed(): Array<Throwable>
initCause
Link copied to clipboard
open fun initCause(cause: Throwable): Throwable
printStackTrace
Link copied to clipboard
open fun printStackTrace()
toString
Link copied to clipboard
open fun toString(): String

## Properties

cause
Link copied to clipboard
open val cause: Throwable
stackTrace
Link copied to clipboard
open var stackTrace: Array<StackTraceElement>