expectErrorType

open fun <E : Throwable> expectErrorType(expected: KClass<E>): AE

Expects an error of a specific type.

This method validates that an error occurred and that it is an instance of the expected Throwable type.

Return

the current expecter instance for method chaining

Parameters

E

the expected type of the Throwable

expected

the KClass representing the expected error type

Throws

if no error occurred or the error is not of the expected type


open fun <E : Throwable> expectErrorType(expected: Class<E>): AE

Expects an error of a specific type (Java-friendly overload).

This method accepts a Class object instead of KClass, making it more convenient for Java integration while maintaining the same validation logic.

Return

the current expecter instance for method chaining

Parameters

E

the expected type of the Throwable

expected

the Class representing the expected error type

Throws

if no error occurred or the error is not of the expected type