{"action":"opened","issue":{"url":"https://api.github.com/repos/swoft-cloud/swoft/issues/439","repository_url":"https://api.github.com/repos/swoft-cloud/swoft","labels_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/439/labels{/name}","comments_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/439/comments","events_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/439/events","html_url":"https://github.com/swoft-cloud/swoft/issues/439","id":376640504,"node_id":"MDU6SXNzdWUzNzY2NDA1MDQ=","number":439,"title":"ExceptionHandler功能改进","user":{"login":"woodongwong","id":9292647,"node_id":"MDQ6VXNlcjkyOTI2NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/9292647?v=4","gravatar_id":"","url":"https://api.github.com/users/woodongwong","html_url":"https://github.com/woodongwong","followers_url":"https://api.github.com/users/woodongwong/followers","following_url":"https://api.github.com/users/woodongwong/following{/other_user}","gists_url":"https://api.github.com/users/woodongwong/gists{/gist_id}","starred_url":"https://api.github.com/users/woodongwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woodongwong/subscriptions","organizations_url":"https://api.github.com/users/woodongwong/orgs","repos_url":"https://api.github.com/users/woodongwong/repos","events_url":"https://api.github.com/users/woodongwong/events{/privacy}","received_events_url":"https://api.github.com/users/woodongwong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-02T02:07:47Z","updated_at":"2018-11-02T02:07:47Z","closed_at":null,"author_association":"NONE","body":"| Q                   | A\r\n| ------------------- | -----\r\n| Bug report?         | no\r\n| Feature request?    | yes\r\n| Swoft version       | future\r\n| Swoole version      | -\r\n| PHP version         | -\r\n| Runtime environment | -\r\n\r\n**Details**\r\n\r\n```php\r\n<?php\r\n\r\nclass BaseException extends Exception\r\n{\r\n\r\n}\r\n\r\nclass AException extends BaseException\r\n{\r\n\r\n}\r\n\r\nclass BException extends AException\r\n{\r\n    \r\n}\r\n\r\nuse Swoft\\Bean\\Annotation\\ExceptionHandler;\r\nuse Swoft\\Bean\\Annotation\\Handler;\r\nuse Swoft\\Http\\Message\\Server\\Response;\r\n\r\n/**\r\n * @ExceptionHandler()\r\n */\r\nclass SwoftExceptionHandler\r\n{\r\n    /**\r\n     * @Handler(BaseException::class)\r\n     *\r\n     * @param Response   $response\r\n     * @param \\Throwable $throwable\r\n     *\r\n     * @return Response\r\n     */\r\n    public function handlerBaseException(Response $response, \\Throwable $throwable)\r\n    {\r\n        // 这里希望可以“捕捉”到BException、AException、BaseException\r\n    }\r\n\r\n    /**\r\n     * @Handler(AException::class)\r\n     *\r\n     * @param Response   $response\r\n     * @param \\Throwable $throwable\r\n     *\r\n     * @return Response\r\n     */\r\n    public function handlerAException(Response $response, \\Throwable $throwable)\r\n    {\r\n        // 这里希望可以“捕捉”到BException和AException\r\n    }\r\n\r\n    // 与try catch不同的是，按照“由窄到宽”的顺序。\r\n}\r\n\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"woodongwong"}}