php-ddd-example
php-ddd-example copied to clipboard
Catch HandlerFailedExceptions on InMemorySymfonyQueryBus.php
The InMemorySymfonyQueryBus.php implementation should catch HandlerFailedExceptions to get the throwed exception from the query handler.
This way, ApiExceptionListener can correctly map the status code for the exception.
Without this fix, all exceptions throwed by the query bus, while the ApiExceptionListener is on, would read as an HandlerFailedException, regardless of the exception mappings defined in the controller.