Annotated Exception Handling

Axon Framework allows the use of methods annotated with @ExceptionHandler to provide more fine-grained control on how to react to exceptions. More specifically, this is a type of component-level interceptor dedicated to reacting to exceptional results.

An @ExceptionHandler method only handles exceptions thrown from message handling functions in the same class. It can react to all exceptions or narrow its scope using the resultType attribute.

For full documentation including examples for command handlers, query handlers, and event processors, see Component Message Intercepting - @ExceptionHandler.