Annotation Interface ExceptionHandler


@Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) public @interface ExceptionHandler
Annotation marking a Handler as an interceptor for other handlers that is only interested in handling exception results. This handler method will be invoked after a regular handler has been executed and may receive the result of that handler as a parameter.

A handler will only be invoked when the parameters of this method match the combination of the handled Message and the result of the handler method invocation.

Since:
4.4.0
Author:
Allard Buijze
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Message>
    Specifies the type of message that can be handled by the member method.
    Class<? extends Exception>
    Defines the type of result this handler needs to be triggered for.
  • Element Details

    • resultType

      Class<? extends Exception> resultType
      Defines the type of result this handler needs to be triggered for. Defaults to all Exceptions.
      Default:
      java.lang.Exception.class
    • messageType

      Class<? extends Message> messageType
      Specifies the type of message that can be handled by the member method. Defaults to any Message.
      Default:
      org.axonframework.messaging.core.Message.class