The reason you are receiving a CommandExecutionException is because you are in a distributed environment.
We have taken the stance with the framework that if the exception needs to go back over the wire to the original dispatcher, that we cannot assume that client has that exception on its classpath.
As such, it’s adjusted to a CommandExecutionException, of which we are certain can be handled.
If you want to share exception details or information, you will have to catch this exception and throw the CommandExecutionException yourself, adding a details object to the constructor.
These details could be a simple message, or maybe a shared status code solution within your domain (not too different from HTTP status codes for example).
Cleanest way to achieve this would be to introduce a MessageHandlerInterceptor which catches the exception thrown by a command handler.
This interceptor can interpret the exception into the details object given to the CommandExecutionException you would then throw.
Hope this helps you further Robert and Martijn!
Cheers,
Steven
PS. It is important to note that this mailing list will be discontinued as specified in this thread.
The thread also specifies where to look further for help when it comes to Axon as soon as this mailing list is closed.