{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/fido/pulls/comments/69874666","id":69874666,"diff_hunk":"@@ -10,12 +10,14 @@\n from twisted.internet.defer import CancelledError\n from twisted.internet.defer import Deferred\n from twisted.internet.endpoints import TCP4ClientEndpoint\n-from twisted.internet.error import TimeoutError as TwistedTimeoutError\n+from twisted.internet.error import ConnectError as TwistedConnectError","path":"fido/fido.py","position":5,"original_position":5,"commit_id":"cdf3bd2bac1f61ce72fa267d758b9ab576d6f0f3","original_commit_id":"cdf3bd2bac1f61ce72fa267d758b9ab576d6f0f3","user":{"login":"lucagiovagnoli","id":4341034,"avatar_url":"https://avatars.githubusercontent.com/u/4341034?v=3","gravatar_id":"","url":"https://api.github.com/users/lucagiovagnoli","html_url":"https://github.com/lucagiovagnoli","followers_url":"https://api.github.com/users/lucagiovagnoli/followers","following_url":"https://api.github.com/users/lucagiovagnoli/following{/other_user}","gists_url":"https://api.github.com/users/lucagiovagnoli/gists{/gist_id}","starred_url":"https://api.github.com/users/lucagiovagnoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucagiovagnoli/subscriptions","organizations_url":"https://api.github.com/users/lucagiovagnoli/orgs","repos_url":"https://api.github.com/users/lucagiovagnoli/repos","events_url":"https://api.github.com/users/lucagiovagnoli/events{/privacy}","received_events_url":"https://api.github.com/users/lucagiovagnoli/received_events","type":"User","site_admin":false},"body":"Twisted TimeoutError is a sub-class of ConnectError. \r\nConnection issues can happen for lots of other reasons than just a timeout while establishing the connection (Unkown host, No route to host) so catching ConnectError should take into account a broader set of reasons.","created_at":"2016-07-07T09:13:53Z","updated_at":"2016-07-07T09:13:53Z","html_url":"https://github.com/Yelp/fido/pull/38#discussion_r69874666","pull_request_url":"https://api.github.com/repos/Yelp/fido/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/Yelp/fido/pulls/comments/69874666"},"html":{"href":"https://github.com/Yelp/fido/pull/38#discussion_r69874666"},"pull_request":{"href":"https://api.github.com/repos/Yelp/fido/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/fido/pulls/38","id":76453603,"html_url":"https://github.com/Yelp/fido/pull/38","diff_url":"https://github.com/Yelp/fido/pull/38.diff","patch_url":"https://github.com/Yelp/fido/pull/38.patch","issue_url":"https://api.github.com/repos/Yelp/fido/issues/38","number":38,"state":"open","locked":false,"title":"Adding Fido custom exceptions","user":{"login":"lucagiovagnoli","id":4341034,"avatar_url":"https://avatars.githubusercontent.com/u/4341034?v=3","gravatar_id":"","url":"https://api.github.com/users/lucagiovagnoli","html_url":"https://github.com/lucagiovagnoli","followers_url":"https://api.github.com/users/lucagiovagnoli/followers","following_url":"https://api.github.com/users/lucagiovagnoli/following{/other_user}","gists_url":"https://api.github.com/users/lucagiovagnoli/gists{/gist_id}","starred_url":"https://api.github.com/users/lucagiovagnoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucagiovagnoli/subscriptions","organizations_url":"https://api.github.com/users/lucagiovagnoli/orgs","repos_url":"https://api.github.com/users/lucagiovagnoli/repos","events_url":"https://api.github.com/users/lucagiovagnoli/events{/privacy}","received_events_url":"https://api.github.com/users/lucagiovagnoli/received_events","type":"User","site_admin":false},"body":"I am refactoring the Fido Timeout exceptions to forward more information (timeout reason) uphill.\r\nCurrently, we have no way to understand which kind of timeout occurred (HTTP request/response or connection timeout?) as all of them are re-raised as a crochet.TimeoutError. \r\n\r\nDistinguishing between timeouts is needed to implement advanced retrying mechanisms.\r\n\r\nAn alternative could be to re-raise twisted underlying exceptions but this would require services to import and have knowledge of Twisted API (with all the reactor-related problems following the import of Twisted code).\r\nPlus in this PR I am introducing a way to group them as a BaseTimeoutError so for cases when we only want to generally catch any timeout, there is no need to selectively import sub-exceptions or Twisted low-level exceptions. ","created_at":"2016-07-06T15:38:52Z","updated_at":"2016-07-07T09:13:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76a6851f77b7d2834e23deae90b32c315f0c4d7e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/fido/pulls/38/commits","review_comments_url":"https://api.github.com/repos/Yelp/fido/pulls/38/comments","review_comment_url":"https://api.github.com/repos/Yelp/fido/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/fido/issues/38/comments","statuses_url":"https://api.github.com/repos/Yelp/fido/statuses/cdf3bd2bac1f61ce72fa267d758b9ab576d6f0f3","head":{"label":"lucagiovagnoli:luca/refactor_fido_exceptions","ref":"luca/refactor_fido_exceptions","sha":"cdf3bd2bac1f61ce72fa267d758b9ab576d6f0f3","user":{"login":"lucagiovagnoli","id":4341034,"avatar_url":"https://avatars.githubusercontent.com/u/4341034?v=3","gravatar_id":"","url":"https://api.github.com/users/lucagiovagnoli","html_url":"https://github.com/lucagiovagnoli","followers_url":"https://api.github.com/users/lucagiovagnoli/followers","following_url":"https://api.github.com/users/lucagiovagnoli/following{/other_user}","gists_url":"https://api.github.com/users/lucagiovagnoli/gists{/gist_id}","starred_url":"https://api.github.com/users/lucagiovagnoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucagiovagnoli/subscriptions","organizations_url":"https://api.github.com/users/lucagiovagnoli/orgs","repos_url":"https://api.github.com/users/lucagiovagnoli/repos","events_url":"https://api.github.com/users/lucagiovagnoli/events{/privacy}","received_events_url":"https://api.github.com/users/lucagiovagnoli/received_events","type":"User","site_admin":false},"repo":{"id":55529037,"name":"fido","full_name":"lucagiovagnoli/fido","owner":{"login":"lucagiovagnoli","id":4341034,"avatar_url":"https://avatars.githubusercontent.com/u/4341034?v=3","gravatar_id":"","url":"https://api.github.com/users/lucagiovagnoli","html_url":"https://github.com/lucagiovagnoli","followers_url":"https://api.github.com/users/lucagiovagnoli/followers","following_url":"https://api.github.com/users/lucagiovagnoli/following{/other_user}","gists_url":"https://api.github.com/users/lucagiovagnoli/gists{/gist_id}","starred_url":"https://api.github.com/users/lucagiovagnoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucagiovagnoli/subscriptions","organizations_url":"https://api.github.com/users/lucagiovagnoli/orgs","repos_url":"https://api.github.com/users/lucagiovagnoli/repos","events_url":"https://api.github.com/users/lucagiovagnoli/events{/privacy}","received_events_url":"https://api.github.com/users/lucagiovagnoli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lucagiovagnoli/fido","description":"","fork":true,"url":"https://api.github.com/repos/lucagiovagnoli/fido","forks_url":"https://api.github.com/repos/lucagiovagnoli/fido/forks","keys_url":"https://api.github.com/repos/lucagiovagnoli/fido/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lucagiovagnoli/fido/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lucagiovagnoli/fido/teams","hooks_url":"https://api.github.com/repos/lucagiovagnoli/fido/hooks","issue_events_url":"https://api.github.com/repos/lucagiovagnoli/fido/issues/events{/number}","events_url":"https://api.github.com/repos/lucagiovagnoli/fido/events","assignees_url":"https://api.github.com/repos/lucagiovagnoli/fido/assignees{/user}","branches_url":"https://api.github.com/repos/lucagiovagnoli/fido/branches{/branch}","tags_url":"https://api.github.com/repos/lucagiovagnoli/fido/tags","blobs_url":"https://api.github.com/repos/lucagiovagnoli/fido/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lucagiovagnoli/fido/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lucagiovagnoli/fido/git/refs{/sha}","trees_url":"https://api.github.com/repos/lucagiovagnoli/fido/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lucagiovagnoli/fido/statuses/{sha}","languages_url":"https://api.github.com/repos/lucagiovagnoli/fido/languages","stargazers_url":"https://api.github.com/repos/lucagiovagnoli/fido/stargazers","contributors_url":"https://api.github.com/repos/lucagiovagnoli/fido/contributors","subscribers_url":"https://api.github.com/repos/lucagiovagnoli/fido/subscribers","subscription_url":"https://api.github.com/repos/lucagiovagnoli/fido/subscription","commits_url":"https://api.github.com/repos/lucagiovagnoli/fido/commits{/sha}","git_commits_url":"https://api.github.com/repos/lucagiovagnoli/fido/git/commits{/sha}","comments_url":"https://api.github.com/repos/lucagiovagnoli/fido/comments{/number}","issue_comment_url":"https://api.github.com/repos/lucagiovagnoli/fido/issues/comments{/number}","contents_url":"https://api.github.com/repos/lucagiovagnoli/fido/contents/{+path}","compare_url":"https://api.github.com/repos/lucagiovagnoli/fido/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lucagiovagnoli/fido/merges","archive_url":"https://api.github.com/repos/lucagiovagnoli/fido/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lucagiovagnoli/fido/downloads","issues_url":"https://api.github.com/repos/lucagiovagnoli/fido/issues{/number}","pulls_url":"https://api.github.com/repos/lucagiovagnoli/fido/pulls{/number}","milestones_url":"https://api.github.com/repos/lucagiovagnoli/fido/milestones{/number}","notifications_url":"https://api.github.com/repos/lucagiovagnoli/fido/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lucagiovagnoli/fido/labels{/name}","releases_url":"https://api.github.com/repos/lucagiovagnoli/fido/releases{/id}","deployments_url":"https://api.github.com/repos/lucagiovagnoli/fido/deployments","created_at":"2016-04-05T17:42:47Z","updated_at":"2016-04-05T17:42:48Z","pushed_at":"2016-07-06T15:48:28Z","git_url":"git://github.com/lucagiovagnoli/fido.git","ssh_url":"git@github.com:lucagiovagnoli/fido.git","clone_url":"https://github.com/lucagiovagnoli/fido.git","svn_url":"https://github.com/lucagiovagnoli/fido","homepage":null,"size":74,"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":"Yelp:master","ref":"master","sha":"498a2638883d92d1e070c6252b15495e6d7ca414","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":30930589,"name":"fido","full_name":"Yelp/fido","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/fido","description":"Asynchronous HTTP client built on top of Crochet and Twisted","fork":false,"url":"https://api.github.com/repos/Yelp/fido","forks_url":"https://api.github.com/repos/Yelp/fido/forks","keys_url":"https://api.github.com/repos/Yelp/fido/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/fido/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/fido/teams","hooks_url":"https://api.github.com/repos/Yelp/fido/hooks","issue_events_url":"https://api.github.com/repos/Yelp/fido/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/fido/events","assignees_url":"https://api.github.com/repos/Yelp/fido/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/fido/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/fido/tags","blobs_url":"https://api.github.com/repos/Yelp/fido/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/fido/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/fido/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/fido/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/fido/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/fido/languages","stargazers_url":"https://api.github.com/repos/Yelp/fido/stargazers","contributors_url":"https://api.github.com/repos/Yelp/fido/contributors","subscribers_url":"https://api.github.com/repos/Yelp/fido/subscribers","subscription_url":"https://api.github.com/repos/Yelp/fido/subscription","commits_url":"https://api.github.com/repos/Yelp/fido/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/fido/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/fido/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/fido/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/fido/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/fido/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/fido/merges","archive_url":"https://api.github.com/repos/Yelp/fido/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/fido/downloads","issues_url":"https://api.github.com/repos/Yelp/fido/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/fido/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/fido/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/fido/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/fido/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/fido/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/fido/deployments","created_at":"2015-02-17T18:20:32Z","updated_at":"2016-06-15T10:14:28Z","pushed_at":"2016-07-06T15:48:29Z","git_url":"git://github.com/Yelp/fido.git","ssh_url":"git@github.com:Yelp/fido.git","clone_url":"https://github.com/Yelp/fido.git","svn_url":"https://github.com/Yelp/fido","homepage":"","size":75,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":7,"forks":7,"open_issues":7,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/fido/pulls/38"},"html":{"href":"https://github.com/Yelp/fido/pull/38"},"issue":{"href":"https://api.github.com/repos/Yelp/fido/issues/38"},"comments":{"href":"https://api.github.com/repos/Yelp/fido/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/fido/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/fido/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/fido/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/fido/statuses/cdf3bd2bac1f61ce72fa267d758b9ab576d6f0f3"}}}}
{"actor":{"display_login":"lucagiovagnoli"}}