{"action":"created","issue":{"url":"https://api.github.com/repos/arobson/rabbot/issues/57","repository_url":"https://api.github.com/repos/arobson/rabbot","labels_url":"https://api.github.com/repos/arobson/rabbot/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/arobson/rabbot/issues/57/comments","events_url":"https://api.github.com/repos/arobson/rabbot/issues/57/events","html_url":"https://github.com/arobson/rabbot/issues/57","id":194005490,"number":57,"title":"rabbit.request().progress() swallowing errors","user":{"login":"grimurd","id":4043301,"avatar_url":"https://avatars.githubusercontent.com/u/4043301?v=3","gravatar_id":"","url":"https://api.github.com/users/grimurd","html_url":"https://github.com/grimurd","followers_url":"https://api.github.com/users/grimurd/followers","following_url":"https://api.github.com/users/grimurd/following{/other_user}","gists_url":"https://api.github.com/users/grimurd/gists{/gist_id}","starred_url":"https://api.github.com/users/grimurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grimurd/subscriptions","organizations_url":"https://api.github.com/users/grimurd/orgs","repos_url":"https://api.github.com/users/grimurd/repos","events_url":"https://api.github.com/users/grimurd/events{/privacy}","received_events_url":"https://api.github.com/users/grimurd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-07T09:59:54Z","updated_at":"2016-12-27T11:26:32Z","closed_at":null,"body":"When performing a request that has multiple replies, if an error is thrown in the progress() method it seems to be completely swallowed.\r\n\r\nExample code: \r\n```\r\n        rabbot\r\n            .request('exchange', {})\r\n            .progress(reply => {\r\n                throw new Error('ERR')\r\n            })\r\n            .then(final => {\r\n                console.log('final', final);\r\n            })\r\n            .catch(err => console.error(err));\r\n```\r\nNothing is logged to the console until the last response arrives. If an error is thrown in the .then() method then it gets propagated down correctly and is logged.\r\n\r\nI understand that this something that needs to be handled in a specific way but if this is intended behavior it needs to be documented. I also suggest that any uncaught errors in the progress() method should be printed to the console.\r\n\r\n*EDIT* After looking at the code this seems to be a part of the when promise library. Which has [deprecated the progress method](https://github.com/cujojs/when/blob/master/docs/api.md#progress-events-are-deprecated). So this will have to be implemented in a different way sometime in the near future. Documenting this behavior will probably be sufficient until that happens.\r\n"},"comment":{"url":"https://api.github.com/repos/arobson/rabbot/issues/comments/269313600","html_url":"https://github.com/arobson/rabbot/issues/57#issuecomment-269313600","issue_url":"https://api.github.com/repos/arobson/rabbot/issues/57","id":269313600,"user":{"login":"iamjochem","id":792188,"avatar_url":"https://avatars.githubusercontent.com/u/792188?v=3","gravatar_id":"","url":"https://api.github.com/users/iamjochem","html_url":"https://github.com/iamjochem","followers_url":"https://api.github.com/users/iamjochem/followers","following_url":"https://api.github.com/users/iamjochem/following{/other_user}","gists_url":"https://api.github.com/users/iamjochem/gists{/gist_id}","starred_url":"https://api.github.com/users/iamjochem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamjochem/subscriptions","organizations_url":"https://api.github.com/users/iamjochem/orgs","repos_url":"https://api.github.com/users/iamjochem/repos","events_url":"https://api.github.com/users/iamjochem/events{/privacy}","received_events_url":"https://api.github.com/users/iamjochem/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T11:26:32Z","updated_at":"2016-12-27T11:26:32Z","body":"when.js is not the only Promise lib to effectively abandon support for progress: http://bluebirdjs.com/docs/api/progression-migration.html (that page offers a few alternatively strategies for tracking progress which might be of interest here)"}}
{"actor":{"display_login":"iamjochem"}}