{"action":"opened","number":23,"pull_request":{"url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/23","id":90166202,"html_url":"https://github.com/sensiolabs/consul-php-sdk/pull/23","diff_url":"https://github.com/sensiolabs/consul-php-sdk/pull/23.diff","patch_url":"https://github.com/sensiolabs/consul-php-sdk/pull/23.patch","issue_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues/23","number":23,"state":"open","locked":false,"title":"Add http status code on exceptions","user":{"login":"Gufran","id":2152267,"avatar_url":"https://avatars.githubusercontent.com/u/2152267?v=3","gravatar_id":"","url":"https://api.github.com/users/Gufran","html_url":"https://github.com/Gufran","followers_url":"https://api.github.com/users/Gufran/followers","following_url":"https://api.github.com/users/Gufran/following{/other_user}","gists_url":"https://api.github.com/users/Gufran/gists{/gist_id}","starred_url":"https://api.github.com/users/Gufran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gufran/subscriptions","organizations_url":"https://api.github.com/users/Gufran/orgs","repos_url":"https://api.github.com/users/Gufran/repos","events_url":"https://api.github.com/users/Gufran/events{/privacy}","received_events_url":"https://api.github.com/users/Gufran/received_events","type":"User","site_admin":false},"body":"This changeset makes the HTTP status code available on the exception message. Right now there is no way to distinguish between different HTTP errors that could happen except for a string match on exception message, it results in code like\r\n\r\n```php\r\nif (stristr($exception->getMessage(), '404 - Not Found')) {\r\n   //... Logic here\r\n}\r\n```\r\n\r\nwhich is not really scalable. After this change will be possible to write code like\r\n\r\n```php\r\nif ($exception->getCode() == 400) {\r\n   //... Logic here\r\n}\r\n```","created_at":"2016-10-20T09:45:40Z","updated_at":"2016-10-20T09:45:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/23/commits","review_comments_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/23/comments","review_comment_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues/23/comments","statuses_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/statuses/9af602b20e8b48bd7b630ea574cf0e3613887a65","head":{"label":"Gufran:master","ref":"master","sha":"9af602b20e8b48bd7b630ea574cf0e3613887a65","user":{"login":"Gufran","id":2152267,"avatar_url":"https://avatars.githubusercontent.com/u/2152267?v=3","gravatar_id":"","url":"https://api.github.com/users/Gufran","html_url":"https://github.com/Gufran","followers_url":"https://api.github.com/users/Gufran/followers","following_url":"https://api.github.com/users/Gufran/following{/other_user}","gists_url":"https://api.github.com/users/Gufran/gists{/gist_id}","starred_url":"https://api.github.com/users/Gufran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gufran/subscriptions","organizations_url":"https://api.github.com/users/Gufran/orgs","repos_url":"https://api.github.com/users/Gufran/repos","events_url":"https://api.github.com/users/Gufran/events{/privacy}","received_events_url":"https://api.github.com/users/Gufran/received_events","type":"User","site_admin":false},"repo":{"id":71447902,"name":"consul-php-sdk","full_name":"Gufran/consul-php-sdk","owner":{"login":"Gufran","id":2152267,"avatar_url":"https://avatars.githubusercontent.com/u/2152267?v=3","gravatar_id":"","url":"https://api.github.com/users/Gufran","html_url":"https://github.com/Gufran","followers_url":"https://api.github.com/users/Gufran/followers","following_url":"https://api.github.com/users/Gufran/following{/other_user}","gists_url":"https://api.github.com/users/Gufran/gists{/gist_id}","starred_url":"https://api.github.com/users/Gufran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gufran/subscriptions","organizations_url":"https://api.github.com/users/Gufran/orgs","repos_url":"https://api.github.com/users/Gufran/repos","events_url":"https://api.github.com/users/Gufran/events{/privacy}","received_events_url":"https://api.github.com/users/Gufran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gufran/consul-php-sdk","description":"PHP Consul SDK","fork":true,"url":"https://api.github.com/repos/Gufran/consul-php-sdk","forks_url":"https://api.github.com/repos/Gufran/consul-php-sdk/forks","keys_url":"https://api.github.com/repos/Gufran/consul-php-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gufran/consul-php-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gufran/consul-php-sdk/teams","hooks_url":"https://api.github.com/repos/Gufran/consul-php-sdk/hooks","issue_events_url":"https://api.github.com/repos/Gufran/consul-php-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Gufran/consul-php-sdk/events","assignees_url":"https://api.github.com/repos/Gufran/consul-php-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Gufran/consul-php-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Gufran/consul-php-sdk/tags","blobs_url":"https://api.github.com/repos/Gufran/consul-php-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gufran/consul-php-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gufran/consul-php-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gufran/consul-php-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gufran/consul-php-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Gufran/consul-php-sdk/languages","stargazers_url":"https://api.github.com/repos/Gufran/consul-php-sdk/stargazers","contributors_url":"https://api.github.com/repos/Gufran/consul-php-sdk/contributors","subscribers_url":"https://api.github.com/repos/Gufran/consul-php-sdk/subscribers","subscription_url":"https://api.github.com/repos/Gufran/consul-php-sdk/subscription","commits_url":"https://api.github.com/repos/Gufran/consul-php-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gufran/consul-php-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gufran/consul-php-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gufran/consul-php-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gufran/consul-php-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Gufran/consul-php-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gufran/consul-php-sdk/merges","archive_url":"https://api.github.com/repos/Gufran/consul-php-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gufran/consul-php-sdk/downloads","issues_url":"https://api.github.com/repos/Gufran/consul-php-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Gufran/consul-php-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Gufran/consul-php-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Gufran/consul-php-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gufran/consul-php-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Gufran/consul-php-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Gufran/consul-php-sdk/deployments","created_at":"2016-10-20T09:40:11Z","updated_at":"2016-10-20T09:40:12Z","pushed_at":"2016-10-20T09:42:12Z","git_url":"git://github.com/Gufran/consul-php-sdk.git","ssh_url":"git@github.com:Gufran/consul-php-sdk.git","clone_url":"https://github.com/Gufran/consul-php-sdk.git","svn_url":"https://github.com/Gufran/consul-php-sdk","homepage":"","size":45,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"sensiolabs:master","ref":"master","sha":"4adfc1441f7a29aac815f44aa7169bd950583077","user":{"login":"sensiolabs","id":1780787,"avatar_url":"https://avatars.githubusercontent.com/u/1780787?v=3","gravatar_id":"","url":"https://api.github.com/users/sensiolabs","html_url":"https://github.com/sensiolabs","followers_url":"https://api.github.com/users/sensiolabs/followers","following_url":"https://api.github.com/users/sensiolabs/following{/other_user}","gists_url":"https://api.github.com/users/sensiolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/sensiolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensiolabs/subscriptions","organizations_url":"https://api.github.com/users/sensiolabs/orgs","repos_url":"https://api.github.com/users/sensiolabs/repos","events_url":"https://api.github.com/users/sensiolabs/events{/privacy}","received_events_url":"https://api.github.com/users/sensiolabs/received_events","type":"Organization","site_admin":false},"repo":{"id":26757079,"name":"consul-php-sdk","full_name":"sensiolabs/consul-php-sdk","owner":{"login":"sensiolabs","id":1780787,"avatar_url":"https://avatars.githubusercontent.com/u/1780787?v=3","gravatar_id":"","url":"https://api.github.com/users/sensiolabs","html_url":"https://github.com/sensiolabs","followers_url":"https://api.github.com/users/sensiolabs/followers","following_url":"https://api.github.com/users/sensiolabs/following{/other_user}","gists_url":"https://api.github.com/users/sensiolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/sensiolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensiolabs/subscriptions","organizations_url":"https://api.github.com/users/sensiolabs/orgs","repos_url":"https://api.github.com/users/sensiolabs/repos","events_url":"https://api.github.com/users/sensiolabs/events{/privacy}","received_events_url":"https://api.github.com/users/sensiolabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sensiolabs/consul-php-sdk","description":"PHP Consul SDK","fork":false,"url":"https://api.github.com/repos/sensiolabs/consul-php-sdk","forks_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/forks","keys_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/teams","hooks_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/hooks","issue_events_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/events","assignees_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/tags","blobs_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/languages","stargazers_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/stargazers","contributors_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/contributors","subscribers_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/subscribers","subscription_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/subscription","commits_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/merges","archive_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/downloads","issues_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/labels{/name}","releases_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/sensiolabs/consul-php-sdk/deployments","created_at":"2014-11-17T13:10:57Z","updated_at":"2016-10-20T08:00:51Z","pushed_at":"2016-10-20T09:45:40Z","git_url":"git://github.com/sensiolabs/consul-php-sdk.git","ssh_url":"git@github.com:sensiolabs/consul-php-sdk.git","clone_url":"https://github.com/sensiolabs/consul-php-sdk.git","svn_url":"https://github.com/sensiolabs/consul-php-sdk","homepage":"","size":45,"stargazers_count":109,"watchers_count":109,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":7,"forks":28,"open_issues":7,"watchers":109,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/23"},"html":{"href":"https://github.com/sensiolabs/consul-php-sdk/pull/23"},"issue":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues/23"},"comments":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/sensiolabs/consul-php-sdk/statuses/9af602b20e8b48bd7b630ea574cf0e3613887a65"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"Gufran"}}