{"action":"created","issue":{"url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/issues/6","labels_url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/issues/6/comments","events_url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/issues/6/events","html_url":"https://github.com/promises-aplus/unhandled-rejections-spec/issues/6","id":9169390,"number":6,"title":"Track and allow printing of unhandled rejections","user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/labels/idea","name":"idea","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2012-12-11T05:15:46Z","updated_at":"2015-05-25T23:37:11Z","closed_at":null,"body":"The idea here would be, whenever an unhandled rejection occurs, add it to some array (or perhaps `WeakMap`). If it gets handled later, remove it from that array.\r\n\r\nThen, allow printing of the unhandled rejection list. Either add is as a property to the library, or to a global environment (cf #2), or print it automatically on program exit/window onload, or print it periodically and automatically in debug mode, or...\r\n\r\nThis seems unlikely to solve the problem by itself. It's not a great experience to debug for hours before thinking to check the magic unhandled rejection list. Tooling could help, but then we're back at #2."},"comment":{"url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/issues/comments/105335603","html_url":"https://github.com/promises-aplus/unhandled-rejections-spec/issues/6#issuecomment-105335603","issue_url":"https://api.github.com/repos/promises-aplus/unhandled-rejections-spec/issues/6","id":105335603,"user":{"login":"Zoltu","id":886059,"avatar_url":"https://avatars.githubusercontent.com/u/886059?v=3","gravatar_id":"","url":"https://api.github.com/users/Zoltu","html_url":"https://github.com/Zoltu","followers_url":"https://api.github.com/users/Zoltu/followers","following_url":"https://api.github.com/users/Zoltu/following{/other_user}","gists_url":"https://api.github.com/users/Zoltu/gists{/gist_id}","starred_url":"https://api.github.com/users/Zoltu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zoltu/subscriptions","organizations_url":"https://api.github.com/users/Zoltu/orgs","repos_url":"https://api.github.com/users/Zoltu/repos","events_url":"https://api.github.com/users/Zoltu/events{/privacy}","received_events_url":"https://api.github.com/users/Zoltu/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T23:37:10Z","updated_at":"2015-05-25T23:37:10Z","body":":+1: \tI know I am over 2 years late to the party, but I figured I would offer my 2 cents.\r\n\r\nThe problem I see with any proposal that has immediate consequences for unhandled rejection is that it discourages the use of promises as first class objects.  This proposal makes it so you can pass around rejected promises without being slammed with errors by your tools or crashing your app,  At the same time, your tools can give you insight into the state of your unhandled rejections at an appropriate time.  For example, when you break in a debugger it could immediately show you all  unhandled rejections."}}