-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Symfony\Component\Debug\Exception\FlattenException does not store the original exception. In consequence, any property of the original exception that is not particularly handled by FlattenException gets lost. For example, if the original exception implements the interface HTTPExceptionInterface, the status code and headers a copied over. It would be nice to have a more general solution.
My problem at hand is the following: I implemented some additional exceptions that are actually derived from AccessDeniedHTTPException, BadRequestHTTPException and son on. These customized exception classes are augmented by some properties. Moreover I implemented a custom ExceptionController (derived from the standard ExceptionController from the TWIG bundle) and registered it as a service. The problem: I cannot access the additional properties of my custom exception classes, because they are lost as the ExceptionController only obtains a FlattenException.