# IllegalStateException constructor

IllegalStateException(

1. String message, {
2. Object? cause,

})

Signals that a method has been invoked at an illegal or inappropriate time.

Often used when a component has not yet been initialized or is already shut down, and a method requiring a valid state is called.

Example:

    throw IllegalStateException('ApplicationContext is not active');

## Implementation

    IllegalStateException(super.message, {super.cause});