{"action":"closed","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/27201","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/27201/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/27201/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/27201/events","html_url":"https://github.com/symfony/symfony/issues/27201","id":321256131,"node_id":"MDU6SXNzdWUzMjEyNTYxMzE=","number":27201,"title":"[Debug] Ability to register custom fatal error handlers","user":{"login":"fduch","id":1204137,"node_id":"MDQ6VXNlcjEyMDQxMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/1204137?v=4","gravatar_id":"","url":"https://api.github.com/users/fduch","html_url":"https://github.com/fduch","followers_url":"https://api.github.com/users/fduch/followers","following_url":"https://api.github.com/users/fduch/following{/other_user}","gists_url":"https://api.github.com/users/fduch/gists{/gist_id}","starred_url":"https://api.github.com/users/fduch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fduch/subscriptions","organizations_url":"https://api.github.com/users/fduch/orgs","repos_url":"https://api.github.com/users/fduch/repos","events_url":"https://api.github.com/users/fduch/events{/privacy}","received_events_url":"https://api.github.com/users/fduch/received_events","type":"User","site_admin":false},"labels":[{"id":49125875,"node_id":"MDU6TGFiZWw0OTEyNTg3NQ==","url":"https://api.github.com/repos/symfony/symfony/labels/Debug","name":"Debug","color":"DDDDDD","default":false},{"id":100378,"node_id":"MDU6TGFiZWwxMDAzNzg=","url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":520300257,"node_id":"MDU6TGFiZWw1MjAzMDAyNTc=","url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Waiting%20feedback","name":"Status: Waiting feedback","color":"fef2c0","default":false},{"id":2932845,"node_id":"MDU6TGFiZWwyOTMyODQ1","url":"https://api.github.com/repos/symfony/symfony/labels/Unconfirmed","name":"Unconfirmed","color":"444444","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-08T16:23:23Z","updated_at":"2018-06-15T10:32:13Z","closed_at":"2018-06-15T10:32:13Z","author_association":"CONTRIBUTOR","body":"My purpose is to register custom fatal error handler inside my own bundle. \r\n\r\nAs i initially understood the right way to do it is to override [ErrorHandler's getFatalErrorHandlers](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Debug/ErrorHandler.php#L653) method. \r\n\r\nThe entire problem here is that i am not sure about how to replace original error handler with extended one. \r\n\r\nMy first attempt involved substitution of original error handler inside my bundle's boot method:\r\n\r\n```php\r\nclass MyBundle extends Bundle\r\n{\r\n    /**\r\n     * {@inheritdoc}\r\n     */\r\n    public function boot()\r\n    {\r\n        ErrorHandler::register(new MyErrorHandler($this->container), true)\r\n            ->throwAt($this->container->getParameter('debug.error_handler.throw_at'), true);\r\n    }\r\n}\r\n```\r\nBut after https://github.com/symfony/symfony/pull/15521 was merged this approach became inconsistent with Debug::enable since initial error handler is registered depending on `$displayErrors` inside Debug::enable and after that it is hardly replaced by custom one (and original one is lost). \r\n\r\nSo what is the right way to register custom fatal error handler without making all the things by myself (i mean replacing Debug::enable with custom logic that registers custom error handler)?\r\n\r\nMay be it would be reasonable to add something like `addFatalErrorHandler` method to ErrorHandler in order to make possible dynamic registration of fatal handlers?"}}
{"actor":{"display_login":"fduch"}}