expectError

open fun expectError(): AE

Expects that an error occurred during command execution.

This method validates that the command execution resulted in an exception or error condition, without specifying the error type.

Return

the current expecter instance for method chaining

Throws

if no error occurred during command execution


open fun <E : Throwable> expectError(expected: E.() -> Unit): AE

Expects a specific error with detailed validation.

This method validates both that an error occurred and that it matches the expected error type and properties.

Return

the current expecter instance for method chaining

Parameters

E

the expected type of the Throwable

expected

a lambda function that receives the error and performs detailed assertions

Throws

if no error occurred or the error doesn't match expectations

if the error cannot be cast to the expected type


open fun <E : Throwable> expectError(expected: Consumer<E>): AE

Expects a specific error with detailed validation using a Consumer.

Java-friendly overload for expectError that accepts a Consumer instead of a lambda.

Return

the current expecter instance for method chaining

Parameters

E

the expected type of the Throwable

expected

a Consumer that receives the error and performs detailed assertions