# InvalidModelRuleException

@Incubating
open class InvalidModelRuleException : GradleException(source)

### Deprecated

The Gradle software model is deprecated and will be removed in Gradle 10. Use the new component model (e.g. `cpp-application`, `cpp-library`, `swift-application`, `swift-library`, `xctest`) instead.

Thrown when there is a problem with the usage of a model rule.

This exception is different to InvalidModelRuleDeclarationException in that it signifies a problem with using a model rule in a particular context, whereas `InvalidModelRuleDeclarationException` signifies a problem with the declaration of the model rule itself (which therefore means that the rule could not be used in any context).

This exception should always have cause, that provides information about the actual problem.

#### Since

2.2

## Constructors

InvalidModelRuleException
Link copied to clipboard
constructor(descriptor: ModelRuleDescriptor, cause: Throwable)
Creates a new `InvalidModelRuleException`.

## Properties

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

## 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