{"action":"created","comment":{"url":"https://api.github.com/repos/php-http/client-common/pulls/comments/244673579","pull_request_review_id":188599072,"id":244673579,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDY3MzU3OQ==","diff_hunk":"@@ -135,8 +152,29 @@ public function handleRequest(RequestInterface $request, callable $next, callabl\n      *\n      * @return int\n      */\n-    public static function defaultDelay(RequestInterface $request, Exception $e, $retries)\n+    public static function defaultErrorResponseDelay(RequestInterface $request, ResponseInterface $response, $retries)\n     {\n         return pow(2, $retries) * 500000;\n     }\n+\n+    /**\n+     * @param int $retries The number of retries we made before. First time this get called it will be 0.\n+     *\n+     * @return int\n+     */\n+    public static function defaultExceptionDelay(RequestInterface $request, Exception $e, $retries)","path":"src/Plugin/RetryPlugin.php","position":null,"original_position":139,"commit_id":"29ff63793b80d678d19a3bb4e9f5e987f04de61c","original_commit_id":"8bfb2f87f4fcf6f3ea98fa138afc06354f311d1f","user":{"login":"dbu","id":76576,"node_id":"MDQ6VXNlcjc2NTc2","avatar_url":"https://avatars3.githubusercontent.com/u/76576?v=4","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"body":"indeed. missed that when switching between php versions.\r\n\r\nthere are some other places that could have type declarations added. those have nothing to do with this change, so i won't do them here.","created_at":"2019-01-02T07:38:56Z","updated_at":"2019-01-02T07:38:56Z","html_url":"https://github.com/php-http/client-common/pull/139#discussion_r244673579","pull_request_url":"https://api.github.com/repos/php-http/client-common/pulls/139","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/php-http/client-common/pulls/comments/244673579"},"html":{"href":"https://github.com/php-http/client-common/pull/139#discussion_r244673579"},"pull_request":{"href":"https://api.github.com/repos/php-http/client-common/pulls/139"}},"in_reply_to_id":244540839},"pull_request":{"url":"https://api.github.com/repos/php-http/client-common/pulls/139","id":241435696,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNDM1Njk2","html_url":"https://github.com/php-http/client-common/pull/139","diff_url":"https://github.com/php-http/client-common/pull/139.diff","patch_url":"https://github.com/php-http/client-common/pull/139.patch","issue_url":"https://api.github.com/repos/php-http/client-common/issues/139","number":139,"state":"open","locked":false,"title":"no exception should be thrown on server error, but retrying those wou…","user":{"login":"dbu","id":76576,"node_id":"MDQ6VXNlcjc2NTc2","avatar_url":"https://avatars3.githubusercontent.com/u/76576?v=4","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"body":"…ld make sense\r\n\r\n| Q               | A\r\n| --------------- | ---\r\n| Bug fix?        | no\r\n| New feature?    | yes\r\n| BC breaks?      | no\r\n| Deprecations?   | yes\r\n| Related tickets | fixes #126 \r\n| Documentation   | Callbacks are generally not documented at http://docs.php-http.org/en/latest/plugins/retry.html ...\r\n| License         | MIT\r\n\r\n\r\n#### What's in this PR?\r\n\r\nAdd retry for responses with a server error status code.\r\n\r\n\r\n#### Checklist\r\n\r\n- [x] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix\r\n\r\n#### TODO\r\n\r\n- [ ] Rebase and cleanup when #142 has been merged to master and master to 2.x","created_at":"2018-12-29T09:36:09Z","updated_at":"2019-01-02T07:38:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"680f706bb46684c573cdff3f1be351de69a704fc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/php-http/client-common/milestones/3","html_url":"https://github.com/php-http/client-common/milestone/3","labels_url":"https://api.github.com/repos/php-http/client-common/milestones/3/labels","id":1676929,"node_id":"MDk6TWlsZXN0b25lMTY3NjkyOQ==","number":3,"title":"v2.0.0","description":"","creator":{"login":"sagikazarmark","id":1226384,"node_id":"MDQ6VXNlcjEyMjYzODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1226384?v=4","gravatar_id":"","url":"https://api.github.com/users/sagikazarmark","html_url":"https://github.com/sagikazarmark","followers_url":"https://api.github.com/users/sagikazarmark/followers","following_url":"https://api.github.com/users/sagikazarmark/following{/other_user}","gists_url":"https://api.github.com/users/sagikazarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/sagikazarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagikazarmark/subscriptions","organizations_url":"https://api.github.com/users/sagikazarmark/orgs","repos_url":"https://api.github.com/users/sagikazarmark/repos","events_url":"https://api.github.com/users/sagikazarmark/events{/privacy}","received_events_url":"https://api.github.com/users/sagikazarmark/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":11,"state":"open","created_at":"2016-03-31T20:32:05Z","updated_at":"2018-12-29T09:50:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/php-http/client-common/pulls/139/commits","review_comments_url":"https://api.github.com/repos/php-http/client-common/pulls/139/comments","review_comment_url":"https://api.github.com/repos/php-http/client-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-http/client-common/issues/139/comments","statuses_url":"https://api.github.com/repos/php-http/client-common/statuses/29ff63793b80d678d19a3bb4e9f5e987f04de61c","head":{"label":"php-http:retry-server-errors","ref":"retry-server-errors","sha":"29ff63793b80d678d19a3bb4e9f5e987f04de61c","user":{"login":"php-http","id":12104859,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMTA0ODU5","avatar_url":"https://avatars3.githubusercontent.com/u/12104859?v=4","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":48558536,"node_id":"MDEwOlJlcG9zaXRvcnk0ODU1ODUzNg==","name":"client-common","full_name":"php-http/client-common","private":false,"owner":{"login":"php-http","id":12104859,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMTA0ODU5","avatar_url":"https://avatars3.githubusercontent.com/u/12104859?v=4","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/php-http/client-common","description":"Common HTTP Client implementations and tools for HTTPlug","fork":false,"url":"https://api.github.com/repos/php-http/client-common","forks_url":"https://api.github.com/repos/php-http/client-common/forks","keys_url":"https://api.github.com/repos/php-http/client-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/client-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/client-common/teams","hooks_url":"https://api.github.com/repos/php-http/client-common/hooks","issue_events_url":"https://api.github.com/repos/php-http/client-common/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/client-common/events","assignees_url":"https://api.github.com/repos/php-http/client-common/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/client-common/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/client-common/tags","blobs_url":"https://api.github.com/repos/php-http/client-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/client-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/client-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/client-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/client-common/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/client-common/languages","stargazers_url":"https://api.github.com/repos/php-http/client-common/stargazers","contributors_url":"https://api.github.com/repos/php-http/client-common/contributors","subscribers_url":"https://api.github.com/repos/php-http/client-common/subscribers","subscription_url":"https://api.github.com/repos/php-http/client-common/subscription","commits_url":"https://api.github.com/repos/php-http/client-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/client-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/client-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/client-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/client-common/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/client-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/client-common/merges","archive_url":"https://api.github.com/repos/php-http/client-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/client-common/downloads","issues_url":"https://api.github.com/repos/php-http/client-common/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/client-common/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/client-common/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/client-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/client-common/labels{/name}","releases_url":"https://api.github.com/repos/php-http/client-common/releases{/id}","deployments_url":"https://api.github.com/repos/php-http/client-common/deployments","created_at":"2015-12-24T22:42:10Z","updated_at":"2018-12-31T09:50:11Z","pushed_at":"2019-01-02T07:37:19Z","git_url":"git://github.com/php-http/client-common.git","ssh_url":"git@github.com:php-http/client-common.git","clone_url":"https://github.com/php-http/client-common.git","svn_url":"https://github.com/php-http/client-common","homepage":"http://httplug.io","size":244,"stargazers_count":285,"watchers_count":285,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":28,"open_issues":24,"watchers":285,"default_branch":"master"}},"base":{"label":"php-http:2.x","ref":"2.x","sha":"d3756655d9af8334c2edb2d258d6af2dd37fc764","user":{"login":"php-http","id":12104859,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMTA0ODU5","avatar_url":"https://avatars3.githubusercontent.com/u/12104859?v=4","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":48558536,"node_id":"MDEwOlJlcG9zaXRvcnk0ODU1ODUzNg==","name":"client-common","full_name":"php-http/client-common","private":false,"owner":{"login":"php-http","id":12104859,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMTA0ODU5","avatar_url":"https://avatars3.githubusercontent.com/u/12104859?v=4","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/php-http/client-common","description":"Common HTTP Client implementations and tools for HTTPlug","fork":false,"url":"https://api.github.com/repos/php-http/client-common","forks_url":"https://api.github.com/repos/php-http/client-common/forks","keys_url":"https://api.github.com/repos/php-http/client-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/client-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/client-common/teams","hooks_url":"https://api.github.com/repos/php-http/client-common/hooks","issue_events_url":"https://api.github.com/repos/php-http/client-common/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/client-common/events","assignees_url":"https://api.github.com/repos/php-http/client-common/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/client-common/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/client-common/tags","blobs_url":"https://api.github.com/repos/php-http/client-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/client-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/client-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/client-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/client-common/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/client-common/languages","stargazers_url":"https://api.github.com/repos/php-http/client-common/stargazers","contributors_url":"https://api.github.com/repos/php-http/client-common/contributors","subscribers_url":"https://api.github.com/repos/php-http/client-common/subscribers","subscription_url":"https://api.github.com/repos/php-http/client-common/subscription","commits_url":"https://api.github.com/repos/php-http/client-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/client-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/client-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/client-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/client-common/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/client-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/client-common/merges","archive_url":"https://api.github.com/repos/php-http/client-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/client-common/downloads","issues_url":"https://api.github.com/repos/php-http/client-common/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/client-common/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/client-common/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/client-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/client-common/labels{/name}","releases_url":"https://api.github.com/repos/php-http/client-common/releases{/id}","deployments_url":"https://api.github.com/repos/php-http/client-common/deployments","created_at":"2015-12-24T22:42:10Z","updated_at":"2018-12-31T09:50:11Z","pushed_at":"2019-01-02T07:37:19Z","git_url":"git://github.com/php-http/client-common.git","ssh_url":"git@github.com:php-http/client-common.git","clone_url":"https://github.com/php-http/client-common.git","svn_url":"https://github.com/php-http/client-common","homepage":"http://httplug.io","size":244,"stargazers_count":285,"watchers_count":285,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":28,"open_issues":24,"watchers":285,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-http/client-common/pulls/139"},"html":{"href":"https://github.com/php-http/client-common/pull/139"},"issue":{"href":"https://api.github.com/repos/php-http/client-common/issues/139"},"comments":{"href":"https://api.github.com/repos/php-http/client-common/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/php-http/client-common/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/php-http/client-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-http/client-common/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/php-http/client-common/statuses/29ff63793b80d678d19a3bb4e9f5e987f04de61c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dbu"}}