isValidExceptionHandler

private fun Method.isValidExceptionHandler(allowStatic: Boolean = false): Boolean

Determines whether this method is a valid @ExceptionHandler method according to the event system's rules.

A method is considered a valid exception handler if and only if:

  1. It is annotated with @ExceptionHandler.

  2. It is static only if allowStatic is true, and non-static otherwise.

  3. It returns void.

  4. Its parameter list conforms to one of the supported exception-handler shapes:

    • (event: Event)

    • (throwable: Throwable)

    • (event: Event, throwable: Throwable)

All matching is polymorphic: parameter types may be supertypes of actual dispatched values (e.g. Event, Throwable, or Exception).

Invalid signatures are silently rejected, allowing the subscription logic to skip them naturally—mirroring how normal event handlers are validated and filtered.

Return

true if the method is a valid exception handler; otherwise false.

Parameters

allowStatic

whether static exception-handler methods are permitted.