{"action":"created","issue":{"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/114","repository_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface","labels_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/114/comments","events_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/114/events","html_url":"https://github.com/cyrus-and/chrome-remote-interface/issues/114","id":223537217,"number":114,"title":"Creating a client using the async await method does not catch error","user":{"login":"pthieu","id":2908721,"avatar_url":"https://avatars3.githubusercontent.com/u/2908721?v=3","gravatar_id":"","url":"https://api.github.com/users/pthieu","html_url":"https://github.com/pthieu","followers_url":"https://api.github.com/users/pthieu/followers","following_url":"https://api.github.com/users/pthieu/following{/other_user}","gists_url":"https://api.github.com/users/pthieu/gists{/gist_id}","starred_url":"https://api.github.com/users/pthieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pthieu/subscriptions","organizations_url":"https://api.github.com/users/pthieu/orgs","repos_url":"https://api.github.com/users/pthieu/repos","events_url":"https://api.github.com/users/pthieu/events{/privacy}","received_events_url":"https://api.github.com/users/pthieu/received_events","type":"User","site_admin":false},"labels":[{"id":36298685,"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/labels/not%20an%20issue","name":"not an issue","color":"159818","default":false},{"id":36298686,"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-22T03:35:05Z","updated_at":"2017-04-25T17:01:02Z","closed_at":"2017-04-22T08:15:42Z","body":"Here is my test code:\r\n\r\n```\r\n  CDP(async(client) => {\r\n    console.log('SECTION 1');\r\n    throw new Error('test');\r\n  }).on('error', (e) => {\r\n    console.log('SECTION 2');\r\n  };\r\n```\r\n\r\nOutput is:\r\n```\r\nSECTION 1\r\n(node:12320) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: test\r\n(node:12320) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.\r\n```\r\n\r\nEnvironment:\r\n```\r\nOS: Windows 10\r\n\r\n$ uname -a\r\nMINGW32_NT-6.2 PHONG-PC 1.0.12(0.46/3/2) 2012-07-05 14:56 i686 unknown\r\n\r\n$ node -v\r\nv7.9.0\r\n\r\n$ npm ls chrome-remote-interface\r\nf:\\www\\tmp\r\n`-- chrome-remote-interface@0.19.1\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/comments/297096226","html_url":"https://github.com/cyrus-and/chrome-remote-interface/issues/114#issuecomment-297096226","issue_url":"https://api.github.com/repos/cyrus-and/chrome-remote-interface/issues/114","id":297096226,"user":{"login":"pthieu","id":2908721,"avatar_url":"https://avatars3.githubusercontent.com/u/2908721?v=3","gravatar_id":"","url":"https://api.github.com/users/pthieu","html_url":"https://github.com/pthieu","followers_url":"https://api.github.com/users/pthieu/followers","following_url":"https://api.github.com/users/pthieu/following{/other_user}","gists_url":"https://api.github.com/users/pthieu/gists{/gist_id}","starred_url":"https://api.github.com/users/pthieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pthieu/subscriptions","organizations_url":"https://api.github.com/users/pthieu/orgs","repos_url":"https://api.github.com/users/pthieu/repos","events_url":"https://api.github.com/users/pthieu/events{/privacy}","received_events_url":"https://api.github.com/users/pthieu/received_events","type":"User","site_admin":false},"created_at":"2017-04-25T17:01:02Z","updated_at":"2017-04-25T17:01:02Z","body":"@cyrus-and: hm good points. Was hoping to be able to use all async/await lines. Probably possible to do like this?\r\n```\r\nCDP().then(async(client) => {\r\n    console.log('SECTION 1');\r\n    try {\r\n      await somePromiseCall();\r\n    } catch (e) {\r\n      throw new Error('test');\r\n    }\r\n}).catch((err) => {\r\n    console.log('SECTION 2');\r\n});\r\n```"}}
{"actor":{"display_login":"pthieu"}}