{"action":"closed","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/13168","labels_url":"https://api.github.com/repos/symfony/symfony/issues/13168/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/13168/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/13168/events","html_url":"https://github.com/symfony/symfony/issues/13168","id":53108844,"number":13168,"title":"Wish/Improvement: Store original exception in FlattenException","user":{"login":"nagmat84","id":7428426,"avatar_url":"https://avatars.githubusercontent.com/u/7428426?v=3","gravatar_id":"","url":"https://api.github.com/users/nagmat84","html_url":"https://github.com/nagmat84","followers_url":"https://api.github.com/users/nagmat84/followers","following_url":"https://api.github.com/users/nagmat84/following{/other_user}","gists_url":"https://api.github.com/users/nagmat84/gists{/gist_id}","starred_url":"https://api.github.com/users/nagmat84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagmat84/subscriptions","organizations_url":"https://api.github.com/users/nagmat84/orgs","repos_url":"https://api.github.com/users/nagmat84/repos","events_url":"https://api.github.com/users/nagmat84/events{/privacy}","received_events_url":"https://api.github.com/users/nagmat84/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/HttpKernel","name":"HttpKernel","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-30T11:10:15Z","updated_at":"2015-02-12T12:10:57Z","closed_at":"2015-02-12T12:10:57Z","body":"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.\r\n\r\nMy 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."}}