We have this exception log in production:
“WARN o.a.c.gateway.DefaultCommandGateway - Command ‘’ resulted in org.axonframework.commandhandling.CommandExecutionException(Error handling event of type [class ] in aggregate)”
This does not provide us enough details to solve this error.
Using the approach below is no solution either.
CompletableFuture result = commandGateway.send();
result.whenComplete((response, e) -> //Here the original exception cause is not available);
So what I would like to implement is an generic error handler which catches all runtime exceptions which happen during the command and/or event handling in an aggregate. This generic handler should have access to the original cause exception so that the cause can be logged to our log file.
How can I implement this in Axon?
We use Axon version 4.2 in combination with Spring Boot 2.1.9.