{"action":"created","comment":{"url":"https://api.github.com/repos/scribejava/scribejava/pulls/comments/75845764","id":75845764,"diff_hunk":"@@ -0,0 +1,36 @@\n+package com.github.scribejava.core.model;\n+\n+import java.net.URI;\n+\n+// https://tools.ietf.org/html/rfc6749#section-5.2\n+public class OAuth2ErrorResponse {","path":"scribejava-core/src/main/java/com/github/scribejava/core/model/OAuth2ErrorResponse.java","position":6,"original_position":6,"commit_id":"4b55bb8af292daf6e59e2bddb46d1e1bc172be6a","original_commit_id":"4b55bb8af292daf6e59e2bddb46d1e1bc172be6a","user":{"login":"kullfar","id":736714,"avatar_url":"https://avatars.githubusercontent.com/u/736714?v=3","gravatar_id":"","url":"https://api.github.com/users/kullfar","html_url":"https://github.com/kullfar","followers_url":"https://api.github.com/users/kullfar/followers","following_url":"https://api.github.com/users/kullfar/following{/other_user}","gists_url":"https://api.github.com/users/kullfar/gists{/gist_id}","starred_url":"https://api.github.com/users/kullfar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kullfar/subscriptions","organizations_url":"https://api.github.com/users/kullfar/orgs","repos_url":"https://api.github.com/users/kullfar/repos","events_url":"https://api.github.com/users/kullfar/events{/privacy}","received_events_url":"https://api.github.com/users/kullfar/received_events","type":"User","site_admin":false},"body":"Do we need this class and OAuthRequestException simultaneously?\r\nLooks like we can have just one class\r\n\r\nOAuth2ErrorResponse extends OAuthException\r\nrepresenting \"5.2.  Error Response\" from https://tools.ietf.org/html/rfc6749#section-5.2\r\n","created_at":"2016-08-23T11:17:19Z","updated_at":"2016-08-23T11:17:19Z","html_url":"https://github.com/scribejava/scribejava/pull/696#discussion_r75845764","pull_request_url":"https://api.github.com/repos/scribejava/scribejava/pulls/696","_links":{"self":{"href":"https://api.github.com/repos/scribejava/scribejava/pulls/comments/75845764"},"html":{"href":"https://github.com/scribejava/scribejava/pull/696#discussion_r75845764"},"pull_request":{"href":"https://api.github.com/repos/scribejava/scribejava/pulls/696"}}},"pull_request":{"url":"https://api.github.com/repos/scribejava/scribejava/pulls/696","id":82198126,"html_url":"https://github.com/scribejava/scribejava/pull/696","diff_url":"https://github.com/scribejava/scribejava/pull/696.diff","patch_url":"https://github.com/scribejava/scribejava/pull/696.patch","issue_url":"https://api.github.com/repos/scribejava/scribejava/issues/696","number":696,"state":"open","locked":false,"title":"Manage error response for token request","user":{"login":"juherr","id":254697,"avatar_url":"https://avatars.githubusercontent.com/u/254697?v=3","gravatar_id":"","url":"https://api.github.com/users/juherr","html_url":"https://github.com/juherr","followers_url":"https://api.github.com/users/juherr/followers","following_url":"https://api.github.com/users/juherr/following{/other_user}","gists_url":"https://api.github.com/users/juherr/gists{/gist_id}","starred_url":"https://api.github.com/users/juherr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juherr/subscriptions","organizations_url":"https://api.github.com/users/juherr/orgs","repos_url":"https://api.github.com/users/juherr/repos","events_url":"https://api.github.com/users/juherr/events{/privacy}","received_events_url":"https://api.github.com/users/juherr/received_events","type":"User","site_admin":false},"body":"Sometimes the request is bad and, as a user, I'd like to be able to check what is the problem.\r\n\r\nCurrently, the exception is:\r\n```\r\nCaused by: com.github.scribejava.core.exceptions.OAuthException: Response body is incorrect. Can't extract a '\"access_token\"\\s*:\\s*\"(\\S*?)\"' from this: '{\"error_description\":\"unknown, invalid, or expired refresh token\",\"error\":\"invalid_grant\"}\r\n'\r\n\tat com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extractParameter(OAuth2AccessTokenJsonExtractor.java:64)\r\n\tat com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:37)\r\n\tat com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:12)\r\n\tat com.github.scribejava.core.oauth.OAuth20Service.sendAccessTokenRequestSync(OAuth20Service.java:37)\r\n\tat com.github.scribejava.core.oauth.OAuth20Service.refreshAccessToken(OAuth20Service.java:93)\r\n```\r\n\r\nThe pull-request replaces it by:\r\n```\r\nCaused by: com.github.scribejava.core.exceptions.OAuthRequestException: Get Access token error\r\n\tat com.github.scribejava.core.oauth.OAuth20Service.sendAccessTokenRequestSync(OAuth20Service.java:47)\r\n\tat com.github.scribejava.core.oauth.OAuth20Service.refreshAccessToken(OAuth20Service.java:108)\r\n```","created_at":"2016-08-22T14:12:16Z","updated_at":"2016-08-23T11:17:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0dcc13d2a31ff0acb6307185e38c118a74cf80e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scribejava/scribejava/pulls/696/commits","review_comments_url":"https://api.github.com/repos/scribejava/scribejava/pulls/696/comments","review_comment_url":"https://api.github.com/repos/scribejava/scribejava/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scribejava/scribejava/issues/696/comments","statuses_url":"https://api.github.com/repos/scribejava/scribejava/statuses/4b55bb8af292daf6e59e2bddb46d1e1bc172be6a","head":{"label":"juherr:check-token-response-code","ref":"check-token-response-code","sha":"4b55bb8af292daf6e59e2bddb46d1e1bc172be6a","user":{"login":"juherr","id":254697,"avatar_url":"https://avatars.githubusercontent.com/u/254697?v=3","gravatar_id":"","url":"https://api.github.com/users/juherr","html_url":"https://github.com/juherr","followers_url":"https://api.github.com/users/juherr/followers","following_url":"https://api.github.com/users/juherr/following{/other_user}","gists_url":"https://api.github.com/users/juherr/gists{/gist_id}","starred_url":"https://api.github.com/users/juherr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juherr/subscriptions","organizations_url":"https://api.github.com/users/juherr/orgs","repos_url":"https://api.github.com/users/juherr/repos","events_url":"https://api.github.com/users/juherr/events{/privacy}","received_events_url":"https://api.github.com/users/juherr/received_events","type":"User","site_admin":false},"repo":{"id":63165497,"name":"scribejava","full_name":"juherr/scribejava","owner":{"login":"juherr","id":254697,"avatar_url":"https://avatars.githubusercontent.com/u/254697?v=3","gravatar_id":"","url":"https://api.github.com/users/juherr","html_url":"https://github.com/juherr","followers_url":"https://api.github.com/users/juherr/followers","following_url":"https://api.github.com/users/juherr/following{/other_user}","gists_url":"https://api.github.com/users/juherr/gists{/gist_id}","starred_url":"https://api.github.com/users/juherr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juherr/subscriptions","organizations_url":"https://api.github.com/users/juherr/orgs","repos_url":"https://api.github.com/users/juherr/repos","events_url":"https://api.github.com/users/juherr/events{/privacy}","received_events_url":"https://api.github.com/users/juherr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/juherr/scribejava","description":"Simple OAuth library for Java","fork":true,"url":"https://api.github.com/repos/juherr/scribejava","forks_url":"https://api.github.com/repos/juherr/scribejava/forks","keys_url":"https://api.github.com/repos/juherr/scribejava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juherr/scribejava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juherr/scribejava/teams","hooks_url":"https://api.github.com/repos/juherr/scribejava/hooks","issue_events_url":"https://api.github.com/repos/juherr/scribejava/issues/events{/number}","events_url":"https://api.github.com/repos/juherr/scribejava/events","assignees_url":"https://api.github.com/repos/juherr/scribejava/assignees{/user}","branches_url":"https://api.github.com/repos/juherr/scribejava/branches{/branch}","tags_url":"https://api.github.com/repos/juherr/scribejava/tags","blobs_url":"https://api.github.com/repos/juherr/scribejava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juherr/scribejava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juherr/scribejava/git/refs{/sha}","trees_url":"https://api.github.com/repos/juherr/scribejava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juherr/scribejava/statuses/{sha}","languages_url":"https://api.github.com/repos/juherr/scribejava/languages","stargazers_url":"https://api.github.com/repos/juherr/scribejava/stargazers","contributors_url":"https://api.github.com/repos/juherr/scribejava/contributors","subscribers_url":"https://api.github.com/repos/juherr/scribejava/subscribers","subscription_url":"https://api.github.com/repos/juherr/scribejava/subscription","commits_url":"https://api.github.com/repos/juherr/scribejava/commits{/sha}","git_commits_url":"https://api.github.com/repos/juherr/scribejava/git/commits{/sha}","comments_url":"https://api.github.com/repos/juherr/scribejava/comments{/number}","issue_comment_url":"https://api.github.com/repos/juherr/scribejava/issues/comments{/number}","contents_url":"https://api.github.com/repos/juherr/scribejava/contents/{+path}","compare_url":"https://api.github.com/repos/juherr/scribejava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juherr/scribejava/merges","archive_url":"https://api.github.com/repos/juherr/scribejava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juherr/scribejava/downloads","issues_url":"https://api.github.com/repos/juherr/scribejava/issues{/number}","pulls_url":"https://api.github.com/repos/juherr/scribejava/pulls{/number}","milestones_url":"https://api.github.com/repos/juherr/scribejava/milestones{/number}","notifications_url":"https://api.github.com/repos/juherr/scribejava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juherr/scribejava/labels{/name}","releases_url":"https://api.github.com/repos/juherr/scribejava/releases{/id}","deployments_url":"https://api.github.com/repos/juherr/scribejava/deployments","created_at":"2016-07-12T14:37:48Z","updated_at":"2016-07-12T14:37:49Z","pushed_at":"2016-08-22T13:49:49Z","git_url":"git://github.com/juherr/scribejava.git","ssh_url":"git@github.com:juherr/scribejava.git","clone_url":"https://github.com/juherr/scribejava.git","svn_url":"https://github.com/juherr/scribejava","homepage":"https://github.com/scribejava/scribejava","size":2313,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"scribejava:master","ref":"master","sha":"5175a4164a6e40ceba726eb58d02e911247784e3","user":{"login":"scribejava","id":15140551,"avatar_url":"https://avatars.githubusercontent.com/u/15140551?v=3","gravatar_id":"","url":"https://api.github.com/users/scribejava","html_url":"https://github.com/scribejava","followers_url":"https://api.github.com/users/scribejava/followers","following_url":"https://api.github.com/users/scribejava/following{/other_user}","gists_url":"https://api.github.com/users/scribejava/gists{/gist_id}","starred_url":"https://api.github.com/users/scribejava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scribejava/subscriptions","organizations_url":"https://api.github.com/users/scribejava/orgs","repos_url":"https://api.github.com/users/scribejava/repos","events_url":"https://api.github.com/users/scribejava/events{/privacy}","received_events_url":"https://api.github.com/users/scribejava/received_events","type":"Organization","site_admin":false},"repo":{"id":889932,"name":"scribejava","full_name":"scribejava/scribejava","owner":{"login":"scribejava","id":15140551,"avatar_url":"https://avatars.githubusercontent.com/u/15140551?v=3","gravatar_id":"","url":"https://api.github.com/users/scribejava","html_url":"https://github.com/scribejava","followers_url":"https://api.github.com/users/scribejava/followers","following_url":"https://api.github.com/users/scribejava/following{/other_user}","gists_url":"https://api.github.com/users/scribejava/gists{/gist_id}","starred_url":"https://api.github.com/users/scribejava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scribejava/subscriptions","organizations_url":"https://api.github.com/users/scribejava/orgs","repos_url":"https://api.github.com/users/scribejava/repos","events_url":"https://api.github.com/users/scribejava/events{/privacy}","received_events_url":"https://api.github.com/users/scribejava/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scribejava/scribejava","description":"Simple OAuth library for Java","fork":false,"url":"https://api.github.com/repos/scribejava/scribejava","forks_url":"https://api.github.com/repos/scribejava/scribejava/forks","keys_url":"https://api.github.com/repos/scribejava/scribejava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scribejava/scribejava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scribejava/scribejava/teams","hooks_url":"https://api.github.com/repos/scribejava/scribejava/hooks","issue_events_url":"https://api.github.com/repos/scribejava/scribejava/issues/events{/number}","events_url":"https://api.github.com/repos/scribejava/scribejava/events","assignees_url":"https://api.github.com/repos/scribejava/scribejava/assignees{/user}","branches_url":"https://api.github.com/repos/scribejava/scribejava/branches{/branch}","tags_url":"https://api.github.com/repos/scribejava/scribejava/tags","blobs_url":"https://api.github.com/repos/scribejava/scribejava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scribejava/scribejava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scribejava/scribejava/git/refs{/sha}","trees_url":"https://api.github.com/repos/scribejava/scribejava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scribejava/scribejava/statuses/{sha}","languages_url":"https://api.github.com/repos/scribejava/scribejava/languages","stargazers_url":"https://api.github.com/repos/scribejava/scribejava/stargazers","contributors_url":"https://api.github.com/repos/scribejava/scribejava/contributors","subscribers_url":"https://api.github.com/repos/scribejava/scribejava/subscribers","subscription_url":"https://api.github.com/repos/scribejava/scribejava/subscription","commits_url":"https://api.github.com/repos/scribejava/scribejava/commits{/sha}","git_commits_url":"https://api.github.com/repos/scribejava/scribejava/git/commits{/sha}","comments_url":"https://api.github.com/repos/scribejava/scribejava/comments{/number}","issue_comment_url":"https://api.github.com/repos/scribejava/scribejava/issues/comments{/number}","contents_url":"https://api.github.com/repos/scribejava/scribejava/contents/{+path}","compare_url":"https://api.github.com/repos/scribejava/scribejava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scribejava/scribejava/merges","archive_url":"https://api.github.com/repos/scribejava/scribejava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scribejava/scribejava/downloads","issues_url":"https://api.github.com/repos/scribejava/scribejava/issues{/number}","pulls_url":"https://api.github.com/repos/scribejava/scribejava/pulls{/number}","milestones_url":"https://api.github.com/repos/scribejava/scribejava/milestones{/number}","notifications_url":"https://api.github.com/repos/scribejava/scribejava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scribejava/scribejava/labels{/name}","releases_url":"https://api.github.com/repos/scribejava/scribejava/releases{/id}","deployments_url":"https://api.github.com/repos/scribejava/scribejava/deployments","created_at":"2010-09-05T19:11:40Z","updated_at":"2016-08-23T07:16:27Z","pushed_at":"2016-08-23T09:56:56Z","git_url":"git://github.com/scribejava/scribejava.git","ssh_url":"git@github.com:scribejava/scribejava.git","clone_url":"https://github.com/scribejava/scribejava.git","svn_url":"https://github.com/scribejava/scribejava","homepage":"https://github.com/scribejava/scribejava","size":5160,"stargazers_count":3605,"watchers_count":3605,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1312,"mirror_url":null,"open_issues_count":23,"forks":1312,"open_issues":23,"watchers":3605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scribejava/scribejava/pulls/696"},"html":{"href":"https://github.com/scribejava/scribejava/pull/696"},"issue":{"href":"https://api.github.com/repos/scribejava/scribejava/issues/696"},"comments":{"href":"https://api.github.com/repos/scribejava/scribejava/issues/696/comments"},"review_comments":{"href":"https://api.github.com/repos/scribejava/scribejava/pulls/696/comments"},"review_comment":{"href":"https://api.github.com/repos/scribejava/scribejava/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scribejava/scribejava/pulls/696/commits"},"statuses":{"href":"https://api.github.com/repos/scribejava/scribejava/statuses/4b55bb8af292daf6e59e2bddb46d1e1bc172be6a"}}}}
{"actor":{"display_login":"kullfar"}}