{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/comments/62446583","id":62446583,"diff_hunk":"@@ -92,19 +96,20 @@ def initialize(method, uri, options_or_body = {})\n         def with_filter(filter=nil, &block)\n           filter = filter || block\n           if filter\n-            old_impl = self._method(:call)\n+            @has_retry_filter = filter.is_a? Azure::Core::Http::RetryPolicy\n+            original_call = self._method(:call)\n \n             # support 1.8.7 (define_singleton_method doesn't exist until 1.9.1)","path":"lib/azure/core/http/http_request.rb","position":26,"original_position":26,"commit_id":"1660d3f5deaa7dd7dde626705d3a254392ccde57","original_commit_id":"1660d3f5deaa7dd7dde626705d3a254392ccde57","user":{"login":"yaxia","id":6924781,"avatar_url":"https://avatars.githubusercontent.com/u/6924781?v=3","gravatar_id":"","url":"https://api.github.com/users/yaxia","html_url":"https://github.com/yaxia","followers_url":"https://api.github.com/users/yaxia/followers","following_url":"https://api.github.com/users/yaxia/following{/other_user}","gists_url":"https://api.github.com/users/yaxia/gists{/gist_id}","starred_url":"https://api.github.com/users/yaxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaxia/subscriptions","organizations_url":"https://api.github.com/users/yaxia/orgs","repos_url":"https://api.github.com/users/yaxia/repos","events_url":"https://api.github.com/users/yaxia/events{/privacy}","received_events_url":"https://api.github.com/users/yaxia/received_events","type":"User","site_admin":false},"body":"Though we don't officially announce we support Ruby 2.0 and below, this code can keep us safe when people call with lower version and brings backward compatibility. It is not in the scope of this change, if you still want to remove it, I can do it in another PR of dropping the support for Ruby 2.0 and lower.","created_at":"2016-05-09T03:08:54Z","updated_at":"2016-05-09T03:08:54Z","html_url":"https://github.com/Azure/azure-ruby-asm-core/pull/8#discussion_r62446583","pull_request_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/comments/62446583"},"html":{"href":"https://github.com/Azure/azure-ruby-asm-core/pull/8#discussion_r62446583"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8","id":69018580,"html_url":"https://github.com/Azure/azure-ruby-asm-core/pull/8","diff_url":"https://github.com/Azure/azure-ruby-asm-core/pull/8.diff","patch_url":"https://github.com/Azure/azure-ruby-asm-core/pull/8.patch","issue_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues/8","number":8,"state":"open","locked":false,"title":"Return response instead of raising exception when there is a retry filter","user":{"login":"yaxia","id":6924781,"avatar_url":"https://avatars.githubusercontent.com/u/6924781?v=3","gravatar_id":"","url":"https://api.github.com/users/yaxia","html_url":"https://github.com/yaxia","followers_url":"https://api.github.com/users/yaxia/followers","following_url":"https://api.github.com/users/yaxia/following{/other_user}","gists_url":"https://api.github.com/users/yaxia/gists{/gist_id}","starred_url":"https://api.github.com/users/yaxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaxia/subscriptions","organizations_url":"https://api.github.com/users/yaxia/orgs","repos_url":"https://api.github.com/users/yaxia/repos","events_url":"https://api.github.com/users/yaxia/events{/privacy}","received_events_url":"https://api.github.com/users/yaxia/received_events","type":"User","site_admin":false},"body":"In retry_policy.rb, the signature of `should_retry` is:\r\n     \r\n    def should_retry?(response, retry_data)\r\nIf it always raises exception in http_request.rb when the request doesn't succeed, there is no chance to get the response for the retry filter.\r\n\r\nIn this change, it checks whether there is a retry filter (derived from `Azure::Core::Http::RetryPolicy`). If so, the response will be pass to `should_retry?`, otherwise it will raise exception as before.","created_at":"2016-05-05T14:57:16Z","updated_at":"2016-05-09T03:08:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53ca045bf297908b2e4279de2cb19efc844bfb6b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues/8/comments","statuses_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/statuses/1660d3f5deaa7dd7dde626705d3a254392ccde57","head":{"label":"yaxia:master","ref":"master","sha":"1660d3f5deaa7dd7dde626705d3a254392ccde57","user":{"login":"yaxia","id":6924781,"avatar_url":"https://avatars.githubusercontent.com/u/6924781?v=3","gravatar_id":"","url":"https://api.github.com/users/yaxia","html_url":"https://github.com/yaxia","followers_url":"https://api.github.com/users/yaxia/followers","following_url":"https://api.github.com/users/yaxia/following{/other_user}","gists_url":"https://api.github.com/users/yaxia/gists{/gist_id}","starred_url":"https://api.github.com/users/yaxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaxia/subscriptions","organizations_url":"https://api.github.com/users/yaxia/orgs","repos_url":"https://api.github.com/users/yaxia/repos","events_url":"https://api.github.com/users/yaxia/events{/privacy}","received_events_url":"https://api.github.com/users/yaxia/received_events","type":"User","site_admin":false},"repo":{"id":58120976,"name":"azure-ruby-asm-core","full_name":"yaxia/azure-ruby-asm-core","owner":{"login":"yaxia","id":6924781,"avatar_url":"https://avatars.githubusercontent.com/u/6924781?v=3","gravatar_id":"","url":"https://api.github.com/users/yaxia","html_url":"https://github.com/yaxia","followers_url":"https://api.github.com/users/yaxia/followers","following_url":"https://api.github.com/users/yaxia/following{/other_user}","gists_url":"https://api.github.com/users/yaxia/gists{/gist_id}","starred_url":"https://api.github.com/users/yaxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaxia/subscriptions","organizations_url":"https://api.github.com/users/yaxia/orgs","repos_url":"https://api.github.com/users/yaxia/repos","events_url":"https://api.github.com/users/yaxia/events{/privacy}","received_events_url":"https://api.github.com/users/yaxia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yaxia/azure-ruby-asm-core","description":"Azure Ruby SDK Service Management Core HTTP","fork":true,"url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core","forks_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/forks","keys_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/teams","hooks_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/hooks","issue_events_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/issues/events{/number}","events_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/events","assignees_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/assignees{/user}","branches_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/branches{/branch}","tags_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/tags","blobs_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/languages","stargazers_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/stargazers","contributors_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/contributors","subscribers_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/subscribers","subscription_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/subscription","commits_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/contents/{+path}","compare_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/merges","archive_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/downloads","issues_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/issues{/number}","pulls_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/labels{/name}","releases_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/releases{/id}","deployments_url":"https://api.github.com/repos/yaxia/azure-ruby-asm-core/deployments","created_at":"2016-05-05T09:45:49Z","updated_at":"2016-05-05T09:45:57Z","pushed_at":"2016-05-05T14:52:18Z","git_url":"git://github.com/yaxia/azure-ruby-asm-core.git","ssh_url":"git@github.com:yaxia/azure-ruby-asm-core.git","clone_url":"https://github.com/yaxia/azure-ruby-asm-core.git","svn_url":"https://github.com/yaxia/azure-ruby-asm-core","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"Azure:master","ref":"master","sha":"9370df9f90aa60d775ecaaa2bf6c4b7394fb07cb","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":56031054,"name":"azure-ruby-asm-core","full_name":"Azure/azure-ruby-asm-core","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-ruby-asm-core","description":"Azure Ruby SDK Service Management Core HTTP","fork":false,"url":"https://api.github.com/repos/Azure/azure-ruby-asm-core","forks_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/forks","keys_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/teams","hooks_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/events","assignees_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/tags","blobs_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/subscription","commits_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/merges","archive_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/downloads","issues_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-ruby-asm-core/deployments","created_at":"2016-04-12T04:30:03Z","updated_at":"2016-04-14T17:26:22Z","pushed_at":"2016-05-05T14:57:16Z","git_url":"git://github.com/Azure/azure-ruby-asm-core.git","ssh_url":"git@github.com:Azure/azure-ruby-asm-core.git","clone_url":"https://github.com/Azure/azure-ruby-asm-core.git","svn_url":"https://github.com/Azure/azure-ruby-asm-core","homepage":null,"size":31,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8"},"html":{"href":"https://github.com/Azure/azure-ruby-asm-core/pull/8"},"issue":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues/8"},"comments":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-ruby-asm-core/statuses/1660d3f5deaa7dd7dde626705d3a254392ccde57"}}}}