{"action":"created","comment":{"url":"https://api.github.com/repos/degica/openlogi/pulls/comments/55314824","id":55314824,"diff_hunk":"@@ -13,23 +11,22 @@ def resource_class\n         raise NotImplementedError\n       end\n \n-      private\n-\n       def perform_request(method, resource, options = {})\n         Openlogi::Request.new(client, method, resource, options).perform.tap do |response|\n-          raise InvalidResponseError.new(response) if response.invalid?\n+          client.last_response = response\n+          raise BadRequestError.new(response) if response.bad_request?","path":"lib/openlogi/api/endpoint.rb","position":16,"original_position":16,"commit_id":"0a8079214768607146043ed53c83b28a48418774","original_commit_id":"0a8079214768607146043ed53c83b28a48418774","user":{"login":"shioyama","id":561827,"avatar_url":"https://avatars.githubusercontent.com/u/561827?v=3","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"body":"We might want to have some slightly more sophisticated error handling, it seems the API returns e.g. a 409 on a create if the created item already exists, etc. but for now I figured this would do.","created_at":"2016-03-08T04:23:21Z","updated_at":"2016-03-08T04:23:21Z","html_url":"https://github.com/degica/openlogi/pull/9#discussion_r55314824","pull_request_url":"https://api.github.com/repos/degica/openlogi/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/degica/openlogi/pulls/comments/55314824"},"html":{"href":"https://github.com/degica/openlogi/pull/9#discussion_r55314824"},"pull_request":{"href":"https://api.github.com/repos/degica/openlogi/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/degica/openlogi/pulls/9","id":62017523,"html_url":"https://github.com/degica/openlogi/pull/9","diff_url":"https://github.com/degica/openlogi/pull/9.diff","patch_url":"https://github.com/degica/openlogi/pull/9.patch","issue_url":"https://api.github.com/repos/degica/openlogi/issues/9","number":9,"state":"open","locked":false,"title":"Store last_response even if response is invalid","user":{"login":"shioyama","id":561827,"avatar_url":"https://avatars.githubusercontent.com/u/561827?v=3","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"body":"If the response from openlogi is invalid we currently raise an exception without actually storing the response itself. This change stores the response even if it is invalid, and adds some specs for endpoint code that was not previously tested.","created_at":"2016-03-08T02:56:06Z","updated_at":"2016-03-08T04:23:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5862d296a7864d3827bc01da9bdf0043324ed229","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/degica/openlogi/pulls/9/commits","review_comments_url":"https://api.github.com/repos/degica/openlogi/pulls/9/comments","review_comment_url":"https://api.github.com/repos/degica/openlogi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/degica/openlogi/issues/9/comments","statuses_url":"https://api.github.com/repos/degica/openlogi/statuses/0a8079214768607146043ed53c83b28a48418774","head":{"label":"shioyama:last_response","ref":"last_response","sha":"0a8079214768607146043ed53c83b28a48418774","user":{"login":"shioyama","id":561827,"avatar_url":"https://avatars.githubusercontent.com/u/561827?v=3","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"repo":{"id":52050200,"name":"openlogi","full_name":"shioyama/openlogi","owner":{"login":"shioyama","id":561827,"avatar_url":"https://avatars.githubusercontent.com/u/561827?v=3","gravatar_id":"","url":"https://api.github.com/users/shioyama","html_url":"https://github.com/shioyama","followers_url":"https://api.github.com/users/shioyama/followers","following_url":"https://api.github.com/users/shioyama/following{/other_user}","gists_url":"https://api.github.com/users/shioyama/gists{/gist_id}","starred_url":"https://api.github.com/users/shioyama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shioyama/subscriptions","organizations_url":"https://api.github.com/users/shioyama/orgs","repos_url":"https://api.github.com/users/shioyama/repos","events_url":"https://api.github.com/users/shioyama/events{/privacy}","received_events_url":"https://api.github.com/users/shioyama/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shioyama/openlogi","description":"Unofficial Ruby wrapper for Openlogi API","fork":true,"url":"https://api.github.com/repos/shioyama/openlogi","forks_url":"https://api.github.com/repos/shioyama/openlogi/forks","keys_url":"https://api.github.com/repos/shioyama/openlogi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shioyama/openlogi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shioyama/openlogi/teams","hooks_url":"https://api.github.com/repos/shioyama/openlogi/hooks","issue_events_url":"https://api.github.com/repos/shioyama/openlogi/issues/events{/number}","events_url":"https://api.github.com/repos/shioyama/openlogi/events","assignees_url":"https://api.github.com/repos/shioyama/openlogi/assignees{/user}","branches_url":"https://api.github.com/repos/shioyama/openlogi/branches{/branch}","tags_url":"https://api.github.com/repos/shioyama/openlogi/tags","blobs_url":"https://api.github.com/repos/shioyama/openlogi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shioyama/openlogi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shioyama/openlogi/git/refs{/sha}","trees_url":"https://api.github.com/repos/shioyama/openlogi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shioyama/openlogi/statuses/{sha}","languages_url":"https://api.github.com/repos/shioyama/openlogi/languages","stargazers_url":"https://api.github.com/repos/shioyama/openlogi/stargazers","contributors_url":"https://api.github.com/repos/shioyama/openlogi/contributors","subscribers_url":"https://api.github.com/repos/shioyama/openlogi/subscribers","subscription_url":"https://api.github.com/repos/shioyama/openlogi/subscription","commits_url":"https://api.github.com/repos/shioyama/openlogi/commits{/sha}","git_commits_url":"https://api.github.com/repos/shioyama/openlogi/git/commits{/sha}","comments_url":"https://api.github.com/repos/shioyama/openlogi/comments{/number}","issue_comment_url":"https://api.github.com/repos/shioyama/openlogi/issues/comments{/number}","contents_url":"https://api.github.com/repos/shioyama/openlogi/contents/{+path}","compare_url":"https://api.github.com/repos/shioyama/openlogi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shioyama/openlogi/merges","archive_url":"https://api.github.com/repos/shioyama/openlogi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shioyama/openlogi/downloads","issues_url":"https://api.github.com/repos/shioyama/openlogi/issues{/number}","pulls_url":"https://api.github.com/repos/shioyama/openlogi/pulls{/number}","milestones_url":"https://api.github.com/repos/shioyama/openlogi/milestones{/number}","notifications_url":"https://api.github.com/repos/shioyama/openlogi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shioyama/openlogi/labels{/name}","releases_url":"https://api.github.com/repos/shioyama/openlogi/releases{/id}","deployments_url":"https://api.github.com/repos/shioyama/openlogi/deployments","created_at":"2016-02-19T00:45:54Z","updated_at":"2016-02-19T00:45:55Z","pushed_at":"2016-03-08T04:18:17Z","git_url":"git://github.com/shioyama/openlogi.git","ssh_url":"git@github.com:shioyama/openlogi.git","clone_url":"https://github.com/shioyama/openlogi.git","svn_url":"https://github.com/shioyama/openlogi","homepage":"","size":68,"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":"degica:master","ref":"master","sha":"4eb60c72d98f408fcada9b6963bc76780fe0cda2","user":{"login":"degica","id":1285497,"avatar_url":"https://avatars.githubusercontent.com/u/1285497?v=3","gravatar_id":"","url":"https://api.github.com/users/degica","html_url":"https://github.com/degica","followers_url":"https://api.github.com/users/degica/followers","following_url":"https://api.github.com/users/degica/following{/other_user}","gists_url":"https://api.github.com/users/degica/gists{/gist_id}","starred_url":"https://api.github.com/users/degica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degica/subscriptions","organizations_url":"https://api.github.com/users/degica/orgs","repos_url":"https://api.github.com/users/degica/repos","events_url":"https://api.github.com/users/degica/events{/privacy}","received_events_url":"https://api.github.com/users/degica/received_events","type":"Organization","site_admin":false},"repo":{"id":51733855,"name":"openlogi","full_name":"degica/openlogi","owner":{"login":"degica","id":1285497,"avatar_url":"https://avatars.githubusercontent.com/u/1285497?v=3","gravatar_id":"","url":"https://api.github.com/users/degica","html_url":"https://github.com/degica","followers_url":"https://api.github.com/users/degica/followers","following_url":"https://api.github.com/users/degica/following{/other_user}","gists_url":"https://api.github.com/users/degica/gists{/gist_id}","starred_url":"https://api.github.com/users/degica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degica/subscriptions","organizations_url":"https://api.github.com/users/degica/orgs","repos_url":"https://api.github.com/users/degica/repos","events_url":"https://api.github.com/users/degica/events{/privacy}","received_events_url":"https://api.github.com/users/degica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/degica/openlogi","description":"Unofficial Ruby wrapper for Openlogi API","fork":false,"url":"https://api.github.com/repos/degica/openlogi","forks_url":"https://api.github.com/repos/degica/openlogi/forks","keys_url":"https://api.github.com/repos/degica/openlogi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/degica/openlogi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/degica/openlogi/teams","hooks_url":"https://api.github.com/repos/degica/openlogi/hooks","issue_events_url":"https://api.github.com/repos/degica/openlogi/issues/events{/number}","events_url":"https://api.github.com/repos/degica/openlogi/events","assignees_url":"https://api.github.com/repos/degica/openlogi/assignees{/user}","branches_url":"https://api.github.com/repos/degica/openlogi/branches{/branch}","tags_url":"https://api.github.com/repos/degica/openlogi/tags","blobs_url":"https://api.github.com/repos/degica/openlogi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/degica/openlogi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/degica/openlogi/git/refs{/sha}","trees_url":"https://api.github.com/repos/degica/openlogi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/degica/openlogi/statuses/{sha}","languages_url":"https://api.github.com/repos/degica/openlogi/languages","stargazers_url":"https://api.github.com/repos/degica/openlogi/stargazers","contributors_url":"https://api.github.com/repos/degica/openlogi/contributors","subscribers_url":"https://api.github.com/repos/degica/openlogi/subscribers","subscription_url":"https://api.github.com/repos/degica/openlogi/subscription","commits_url":"https://api.github.com/repos/degica/openlogi/commits{/sha}","git_commits_url":"https://api.github.com/repos/degica/openlogi/git/commits{/sha}","comments_url":"https://api.github.com/repos/degica/openlogi/comments{/number}","issue_comment_url":"https://api.github.com/repos/degica/openlogi/issues/comments{/number}","contents_url":"https://api.github.com/repos/degica/openlogi/contents/{+path}","compare_url":"https://api.github.com/repos/degica/openlogi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/degica/openlogi/merges","archive_url":"https://api.github.com/repos/degica/openlogi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/degica/openlogi/downloads","issues_url":"https://api.github.com/repos/degica/openlogi/issues{/number}","pulls_url":"https://api.github.com/repos/degica/openlogi/pulls{/number}","milestones_url":"https://api.github.com/repos/degica/openlogi/milestones{/number}","notifications_url":"https://api.github.com/repos/degica/openlogi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/degica/openlogi/labels{/name}","releases_url":"https://api.github.com/repos/degica/openlogi/releases{/id}","deployments_url":"https://api.github.com/repos/degica/openlogi/deployments","created_at":"2016-02-15T05:52:39Z","updated_at":"2016-02-19T08:55:28Z","pushed_at":"2016-03-08T04:18:18Z","git_url":"git://github.com/degica/openlogi.git","ssh_url":"git@github.com:degica/openlogi.git","clone_url":"https://github.com/degica/openlogi.git","svn_url":"https://github.com/degica/openlogi","homepage":"","size":49,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/degica/openlogi/pulls/9"},"html":{"href":"https://github.com/degica/openlogi/pull/9"},"issue":{"href":"https://api.github.com/repos/degica/openlogi/issues/9"},"comments":{"href":"https://api.github.com/repos/degica/openlogi/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/degica/openlogi/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/degica/openlogi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/degica/openlogi/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/degica/openlogi/statuses/0a8079214768607146043ed53c83b28a48418774"}}}}