{"action":"closed","number":57,"pull_request":{"url":"https://api.github.com/repos/kennethreitz/grequests/pulls/57","id":17333539,"html_url":"https://github.com/kennethreitz/grequests/pull/57","diff_url":"https://github.com/kennethreitz/grequests/pull/57.diff","patch_url":"https://github.com/kennethreitz/grequests/pull/57.patch","issue_url":"https://api.github.com/repos/kennethreitz/grequests/issues/57","number":57,"state":"closed","locked":false,"title":"Differentiate HTTP errors like 404 from connection errors.","user":{"login":"natecode","id":1581257,"avatar_url":"https://avatars.githubusercontent.com/u/1581257?v=3","gravatar_id":"","url":"https://api.github.com/users/natecode","html_url":"https://github.com/natecode","followers_url":"https://api.github.com/users/natecode/followers","following_url":"https://api.github.com/users/natecode/following{/other_user}","gists_url":"https://api.github.com/users/natecode/gists{/gist_id}","starred_url":"https://api.github.com/users/natecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natecode/subscriptions","organizations_url":"https://api.github.com/users/natecode/orgs","repos_url":"https://api.github.com/users/natecode/repos","events_url":"https://api.github.com/users/natecode/events{/privacy}","received_events_url":"https://api.github.com/users/natecode/received_events","type":"User","site_admin":false},"body":"With the previous code, a 404 or other HTTP error would result in:\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"dload.py\", line 16, in download_urls\r\n    exception_handler=exception_handler):\r\n  File \"/app/lib/python2.7/site-packages/grequests.py\", line 148, in imap\r\n    exception_handler(request, request.exception)\r\nAttributeError: 'AsyncRequest' object has no attribute 'exception'\r\n\r\nThis is because gevent didn't store the exception in the request because an HTTP error does not cause an exception. We're in this case though because request.response evaluates to False if the Response was an HTTP error.\r\n\r\nAlso, can we get a release soon? Version 0.20 is kinda lacking without connection error handling. Thanks.","created_at":"2014-06-19T05:06:02Z","updated_at":"2016-01-31T07:11:42Z","closed_at":"2016-01-31T07:11:42Z","merged_at":"2016-01-31T07:11:42Z","merge_commit_sha":"0cbb01a91e73070fdf0c7f41cd882706fbdf9fe3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kennethreitz/grequests/pulls/57/commits","review_comments_url":"https://api.github.com/repos/kennethreitz/grequests/pulls/57/comments","review_comment_url":"https://api.github.com/repos/kennethreitz/grequests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kennethreitz/grequests/issues/57/comments","statuses_url":"https://api.github.com/repos/kennethreitz/grequests/statuses/ea00e193074fc11d71b4ff74138251f6055ca364","head":{"label":"natecode:master","ref":"master","sha":"ea00e193074fc11d71b4ff74138251f6055ca364","user":{"login":"natecode","id":1581257,"avatar_url":"https://avatars.githubusercontent.com/u/1581257?v=3","gravatar_id":"","url":"https://api.github.com/users/natecode","html_url":"https://github.com/natecode","followers_url":"https://api.github.com/users/natecode/followers","following_url":"https://api.github.com/users/natecode/following{/other_user}","gists_url":"https://api.github.com/users/natecode/gists{/gist_id}","starred_url":"https://api.github.com/users/natecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natecode/subscriptions","organizations_url":"https://api.github.com/users/natecode/orgs","repos_url":"https://api.github.com/users/natecode/repos","events_url":"https://api.github.com/users/natecode/events{/privacy}","received_events_url":"https://api.github.com/users/natecode/received_events","type":"User","site_admin":false},"repo":{"id":20988273,"name":"grequests","full_name":"natecode/grequests","owner":{"login":"natecode","id":1581257,"avatar_url":"https://avatars.githubusercontent.com/u/1581257?v=3","gravatar_id":"","url":"https://api.github.com/users/natecode","html_url":"https://github.com/natecode","followers_url":"https://api.github.com/users/natecode/followers","following_url":"https://api.github.com/users/natecode/following{/other_user}","gists_url":"https://api.github.com/users/natecode/gists{/gist_id}","starred_url":"https://api.github.com/users/natecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natecode/subscriptions","organizations_url":"https://api.github.com/users/natecode/orgs","repos_url":"https://api.github.com/users/natecode/repos","events_url":"https://api.github.com/users/natecode/events{/privacy}","received_events_url":"https://api.github.com/users/natecode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/natecode/grequests","description":"Requests + Gevent = <3","fork":true,"url":"https://api.github.com/repos/natecode/grequests","forks_url":"https://api.github.com/repos/natecode/grequests/forks","keys_url":"https://api.github.com/repos/natecode/grequests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/natecode/grequests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/natecode/grequests/teams","hooks_url":"https://api.github.com/repos/natecode/grequests/hooks","issue_events_url":"https://api.github.com/repos/natecode/grequests/issues/events{/number}","events_url":"https://api.github.com/repos/natecode/grequests/events","assignees_url":"https://api.github.com/repos/natecode/grequests/assignees{/user}","branches_url":"https://api.github.com/repos/natecode/grequests/branches{/branch}","tags_url":"https://api.github.com/repos/natecode/grequests/tags","blobs_url":"https://api.github.com/repos/natecode/grequests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/natecode/grequests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/natecode/grequests/git/refs{/sha}","trees_url":"https://api.github.com/repos/natecode/grequests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/natecode/grequests/statuses/{sha}","languages_url":"https://api.github.com/repos/natecode/grequests/languages","stargazers_url":"https://api.github.com/repos/natecode/grequests/stargazers","contributors_url":"https://api.github.com/repos/natecode/grequests/contributors","subscribers_url":"https://api.github.com/repos/natecode/grequests/subscribers","subscription_url":"https://api.github.com/repos/natecode/grequests/subscription","commits_url":"https://api.github.com/repos/natecode/grequests/commits{/sha}","git_commits_url":"https://api.github.com/repos/natecode/grequests/git/commits{/sha}","comments_url":"https://api.github.com/repos/natecode/grequests/comments{/number}","issue_comment_url":"https://api.github.com/repos/natecode/grequests/issues/comments{/number}","contents_url":"https://api.github.com/repos/natecode/grequests/contents/{+path}","compare_url":"https://api.github.com/repos/natecode/grequests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/natecode/grequests/merges","archive_url":"https://api.github.com/repos/natecode/grequests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/natecode/grequests/downloads","issues_url":"https://api.github.com/repos/natecode/grequests/issues{/number}","pulls_url":"https://api.github.com/repos/natecode/grequests/pulls{/number}","milestones_url":"https://api.github.com/repos/natecode/grequests/milestones{/number}","notifications_url":"https://api.github.com/repos/natecode/grequests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/natecode/grequests/labels{/name}","releases_url":"https://api.github.com/repos/natecode/grequests/releases{/id}","deployments_url":"https://api.github.com/repos/natecode/grequests/deployments","created_at":"2014-06-19T05:00:00Z","updated_at":"2014-06-19T05:06:02Z","pushed_at":"2014-06-19T05:02:46Z","git_url":"git://github.com/natecode/grequests.git","ssh_url":"git@github.com:natecode/grequests.git","clone_url":"https://github.com/natecode/grequests.git","svn_url":"https://github.com/natecode/grequests","homepage":"crate.io/packages/grequests/","size":131,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kennethreitz:master","ref":"master","sha":"5d12c6642c5d11cb46cb6141cd87415c88de878c","user":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"repo":{"id":4290214,"name":"grequests","full_name":"kennethreitz/grequests","owner":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kennethreitz/grequests","description":"Requests + Gevent = <3","fork":false,"url":"https://api.github.com/repos/kennethreitz/grequests","forks_url":"https://api.github.com/repos/kennethreitz/grequests/forks","keys_url":"https://api.github.com/repos/kennethreitz/grequests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kennethreitz/grequests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kennethreitz/grequests/teams","hooks_url":"https://api.github.com/repos/kennethreitz/grequests/hooks","issue_events_url":"https://api.github.com/repos/kennethreitz/grequests/issues/events{/number}","events_url":"https://api.github.com/repos/kennethreitz/grequests/events","assignees_url":"https://api.github.com/repos/kennethreitz/grequests/assignees{/user}","branches_url":"https://api.github.com/repos/kennethreitz/grequests/branches{/branch}","tags_url":"https://api.github.com/repos/kennethreitz/grequests/tags","blobs_url":"https://api.github.com/repos/kennethreitz/grequests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kennethreitz/grequests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kennethreitz/grequests/git/refs{/sha}","trees_url":"https://api.github.com/repos/kennethreitz/grequests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kennethreitz/grequests/statuses/{sha}","languages_url":"https://api.github.com/repos/kennethreitz/grequests/languages","stargazers_url":"https://api.github.com/repos/kennethreitz/grequests/stargazers","contributors_url":"https://api.github.com/repos/kennethreitz/grequests/contributors","subscribers_url":"https://api.github.com/repos/kennethreitz/grequests/subscribers","subscription_url":"https://api.github.com/repos/kennethreitz/grequests/subscription","commits_url":"https://api.github.com/repos/kennethreitz/grequests/commits{/sha}","git_commits_url":"https://api.github.com/repos/kennethreitz/grequests/git/commits{/sha}","comments_url":"https://api.github.com/repos/kennethreitz/grequests/comments{/number}","issue_comment_url":"https://api.github.com/repos/kennethreitz/grequests/issues/comments{/number}","contents_url":"https://api.github.com/repos/kennethreitz/grequests/contents/{+path}","compare_url":"https://api.github.com/repos/kennethreitz/grequests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kennethreitz/grequests/merges","archive_url":"https://api.github.com/repos/kennethreitz/grequests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kennethreitz/grequests/downloads","issues_url":"https://api.github.com/repos/kennethreitz/grequests/issues{/number}","pulls_url":"https://api.github.com/repos/kennethreitz/grequests/pulls{/number}","milestones_url":"https://api.github.com/repos/kennethreitz/grequests/milestones{/number}","notifications_url":"https://api.github.com/repos/kennethreitz/grequests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kennethreitz/grequests/labels{/name}","releases_url":"https://api.github.com/repos/kennethreitz/grequests/releases{/id}","deployments_url":"https://api.github.com/repos/kennethreitz/grequests/deployments","created_at":"2012-05-10T21:50:15Z","updated_at":"2016-01-30T03:02:30Z","pushed_at":"2016-01-31T07:11:42Z","git_url":"git://github.com/kennethreitz/grequests.git","ssh_url":"git@github.com:kennethreitz/grequests.git","clone_url":"https://github.com/kennethreitz/grequests.git","svn_url":"https://github.com/kennethreitz/grequests","homepage":"crate.io/packages/grequests/","size":64,"stargazers_count":1253,"watchers_count":1253,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":153,"mirror_url":null,"open_issues_count":41,"forks":153,"open_issues":41,"watchers":1253,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kennethreitz/grequests/pulls/57"},"html":{"href":"https://github.com/kennethreitz/grequests/pull/57"},"issue":{"href":"https://api.github.com/repos/kennethreitz/grequests/issues/57"},"comments":{"href":"https://api.github.com/repos/kennethreitz/grequests/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/kennethreitz/grequests/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/kennethreitz/grequests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kennethreitz/grequests/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/kennethreitz/grequests/statuses/ea00e193074fc11d71b4ff74138251f6055ca364"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"kennethreitz","id":119893,"avatar_url":"https://avatars.githubusercontent.com/u/119893?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethreitz","html_url":"https://github.com/kennethreitz","followers_url":"https://api.github.com/users/kennethreitz/followers","following_url":"https://api.github.com/users/kennethreitz/following{/other_user}","gists_url":"https://api.github.com/users/kennethreitz/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethreitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethreitz/subscriptions","organizations_url":"https://api.github.com/users/kennethreitz/orgs","repos_url":"https://api.github.com/users/kennethreitz/repos","events_url":"https://api.github.com/users/kennethreitz/events{/privacy}","received_events_url":"https://api.github.com/users/kennethreitz/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":2,"deletions":2,"changed_files":1}}