GradleException

@NullMarked
open class GradleException : RuntimeException, ResolutionProvider(source)

The base class of all exceptions thrown by Gradle.

Implements ResolutionProvider as of Gradle 9.9, to make it simple to provide a list of resolutions for any exception.

Deliberately calls super(X, Y, Z...) constructors instead of using a telescoping constructor pattern, since passing an explicit null cause counts as initializing it, which makes any later initCause call throw IllegalStateException.

Resolutions are tracked as an internal, mutable list, so that nested catch blocks can provide and modify resolutions with additional context.

Since

0.7

Inheritors

Constructors

Link copied to clipboard
constructor()
Creates a new GradleException.
constructor(message: String)
Creates a new GradleException.
constructor(message: String, @Nullable cause: @Nullable Throwable)
Creates a new GradleException.
constructor(message: String, @Nullable cause: @Nullable Throwable, resolutions: Iterable<String>)
Creates a new GradleException carrying the given resolution suggestions.

Properties

Link copied to clipboard
open val cause: Throwable
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun addResolution(resolution: String)
Adds a potential resolution to this exception.
Link copied to clipboard
fun addSuppressed(exception: Throwable)
Link copied to clipboard
Clears the resolutions from this exception.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getMessage(): String
Link copied to clipboard
abstract fun getResolutions(): List<String>
Link copied to clipboard
Link copied to clipboard
open fun initCause(cause: Throwable): Throwable
Link copied to clipboard
open fun printStackTrace()
Link copied to clipboard
open fun toString(): String