{"action":"created","issue":{"url":"https://api.github.com/repos/eggjs/egg/issues/3064","repository_url":"https://api.github.com/repos/eggjs/egg","labels_url":"https://api.github.com/repos/eggjs/egg/issues/3064/labels{/name}","comments_url":"https://api.github.com/repos/eggjs/egg/issues/3064/comments","events_url":"https://api.github.com/repos/eggjs/egg/issues/3064/events","html_url":"https://github.com/eggjs/egg/issues/3064","id":365186393,"node_id":"MDU6SXNzdWUzNjUxODYzOTM=","number":3064,"title":"获取egg-graphql中业务代码抛出的异常","user":{"login":"nigelvon","id":909257,"node_id":"MDQ6VXNlcjkwOTI1Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/909257?v=4","gravatar_id":"","url":"https://api.github.com/users/nigelvon","html_url":"https://github.com/nigelvon","followers_url":"https://api.github.com/users/nigelvon/followers","following_url":"https://api.github.com/users/nigelvon/following{/other_user}","gists_url":"https://api.github.com/users/nigelvon/gists{/gist_id}","starred_url":"https://api.github.com/users/nigelvon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigelvon/subscriptions","organizations_url":"https://api.github.com/users/nigelvon/orgs","repos_url":"https://api.github.com/users/nigelvon/repos","events_url":"https://api.github.com/users/nigelvon/events{/privacy}","received_events_url":"https://api.github.com/users/nigelvon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jtyjty99999","id":893152,"node_id":"MDQ6VXNlcjg5MzE1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/893152?v=4","gravatar_id":"","url":"https://api.github.com/users/jtyjty99999","html_url":"https://github.com/jtyjty99999","followers_url":"https://api.github.com/users/jtyjty99999/followers","following_url":"https://api.github.com/users/jtyjty99999/following{/other_user}","gists_url":"https://api.github.com/users/jtyjty99999/gists{/gist_id}","starred_url":"https://api.github.com/users/jtyjty99999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtyjty99999/subscriptions","organizations_url":"https://api.github.com/users/jtyjty99999/orgs","repos_url":"https://api.github.com/users/jtyjty99999/repos","events_url":"https://api.github.com/users/jtyjty99999/events{/privacy}","received_events_url":"https://api.github.com/users/jtyjty99999/received_events","type":"User","site_admin":false},"assignees":[{"login":"jtyjty99999","id":893152,"node_id":"MDQ6VXNlcjg5MzE1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/893152?v=4","gravatar_id":"","url":"https://api.github.com/users/jtyjty99999","html_url":"https://github.com/jtyjty99999","followers_url":"https://api.github.com/users/jtyjty99999/followers","following_url":"https://api.github.com/users/jtyjty99999/following{/other_user}","gists_url":"https://api.github.com/users/jtyjty99999/gists{/gist_id}","starred_url":"https://api.github.com/users/jtyjty99999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtyjty99999/subscriptions","organizations_url":"https://api.github.com/users/jtyjty99999/orgs","repos_url":"https://api.github.com/users/jtyjty99999/repos","events_url":"https://api.github.com/users/jtyjty99999/events{/privacy}","received_events_url":"https://api.github.com/users/jtyjty99999/received_events","type":"User","site_admin":false},{"login":"thonatos","id":958063,"node_id":"MDQ6VXNlcjk1ODA2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/958063?v=4","gravatar_id":"","url":"https://api.github.com/users/thonatos","html_url":"https://github.com/thonatos","followers_url":"https://api.github.com/users/thonatos/followers","following_url":"https://api.github.com/users/thonatos/following{/other_user}","gists_url":"https://api.github.com/users/thonatos/gists{/gist_id}","starred_url":"https://api.github.com/users/thonatos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thonatos/subscriptions","organizations_url":"https://api.github.com/users/thonatos/orgs","repos_url":"https://api.github.com/users/thonatos/repos","events_url":"https://api.github.com/users/thonatos/events{/privacy}","received_events_url":"https://api.github.com/users/thonatos/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-09-30T02:59:57Z","updated_at":"2018-12-19T08:11:51Z","closed_at":null,"author_association":"NONE","body":"发现graphql请求触发的业务逻辑所抛出的异常都被捕获了，不知道如何获取Error对象，控制台和相关日志找了一圈也没看到。\r\n有什么办法能够获取这些Error么？"},"comment":{"url":"https://api.github.com/repos/eggjs/egg/issues/comments/448505913","html_url":"https://github.com/eggjs/egg/issues/3064#issuecomment-448505913","issue_url":"https://api.github.com/repos/eggjs/egg/issues/3064","id":448505913,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODUwNTkxMw==","user":{"login":"logzh","id":9158889,"node_id":"MDQ6VXNlcjkxNTg4ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/9158889?v=4","gravatar_id":"","url":"https://api.github.com/users/logzh","html_url":"https://github.com/logzh","followers_url":"https://api.github.com/users/logzh/followers","following_url":"https://api.github.com/users/logzh/following{/other_user}","gists_url":"https://api.github.com/users/logzh/gists{/gist_id}","starred_url":"https://api.github.com/users/logzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logzh/subscriptions","organizations_url":"https://api.github.com/users/logzh/orgs","repos_url":"https://api.github.com/users/logzh/repos","events_url":"https://api.github.com/users/logzh/events{/privacy}","received_events_url":"https://api.github.com/users/logzh/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T08:11:51Z","updated_at":"2018-12-19T08:11:51Z","author_association":"NONE","body":"如果是egg-graphql 2.0以下版本，可以将插件中间件复制到项目下修改，覆盖插件里的中间件，具体修改配置graphqlKoa时带上formatError，在formatError中做错误的统一处理。\r\n2.0+之后，同样的方式不灵了因为graphqlKoa api修改了，formatError只能在定义server的时候定义。"}}
{"actor":{"display_login":"logzh"}}