{"action":"created","comment":{"url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/comments/94229100","pull_request_review_id":14760127,"id":94229100,"diff_hunk":"@@ -4,22 +4,38 @@\n from six import string_types\n from requests.exceptions import HTTPError\n \n-from scrapinghub import APIError\n \n+class ScrapinghubAPIError(Exception):\n \n-class DuplicateJobError(APIError):\n+    def __init__(self, origin):\n+        self.origin = origin\n+        message = _get_http_error_msg(origin)\n+        super(ScrapinghubAPIError, self).__init__(message)\n+\n+\n+def _get_http_error_msg(exc):\n+    try:\n+        return exc.response.json()","path":"scrapinghub/utils.py","position":19,"original_position":17,"commit_id":"9bbbc01800c80b06d95b1cc5378bcc8a897a412e","original_commit_id":"b1db9be60bd809db191dbb48bdc2ab2833de28c9","user":{"login":"chekunkov","id":744331,"avatar_url":"https://avatars.githubusercontent.com/u/744331?v=3","gravatar_id":"","url":"https://api.github.com/users/chekunkov","html_url":"https://github.com/chekunkov","followers_url":"https://api.github.com/users/chekunkov/followers","following_url":"https://api.github.com/users/chekunkov/following{/other_user}","gists_url":"https://api.github.com/users/chekunkov/gists{/gist_id}","starred_url":"https://api.github.com/users/chekunkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chekunkov/subscriptions","organizations_url":"https://api.github.com/users/chekunkov/orgs","repos_url":"https://api.github.com/users/chekunkov/repos","events_url":"https://api.github.com/users/chekunkov/events{/privacy}","received_events_url":"https://api.github.com/users/chekunkov/received_events","type":"User","site_admin":false},"body":"you should check if origin is HTTPError","created_at":"2016-12-30T13:57:01Z","updated_at":"2016-12-30T13:59:29Z","html_url":"https://github.com/scrapinghub/python-scrapinghub/pull/38#discussion_r94229100","pull_request_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/comments/94229100"},"html":{"href":"https://github.com/scrapinghub/python-scrapinghub/pull/38#discussion_r94229100"},"pull_request":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38","id":97989778,"html_url":"https://github.com/scrapinghub/python-scrapinghub/pull/38","diff_url":"https://github.com/scrapinghub/python-scrapinghub/pull/38.diff","patch_url":"https://github.com/scrapinghub/python-scrapinghub/pull/38.patch","issue_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/38","number":38,"state":"open","locked":false,"title":"SH Python client update","user":{"login":"vshlapakov","id":448111,"avatar_url":"https://avatars.githubusercontent.com/u/448111?v=3","gravatar_id":"","url":"https://api.github.com/users/vshlapakov","html_url":"https://github.com/vshlapakov","followers_url":"https://api.github.com/users/vshlapakov/followers","following_url":"https://api.github.com/users/vshlapakov/following{/other_user}","gists_url":"https://api.github.com/users/vshlapakov/gists{/gist_id}","starred_url":"https://api.github.com/users/vshlapakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vshlapakov/subscriptions","organizations_url":"https://api.github.com/users/vshlapakov/orgs","repos_url":"https://api.github.com/users/vshlapakov/repos","events_url":"https://api.github.com/users/vshlapakov/events{/privacy}","received_events_url":"https://api.github.com/users/vshlapakov/received_events","type":"User","site_admin":false},"body":"2nd attempt to merge, simplify and fix existing SH python clients, based on composition approach.\r\n\r\nPlease ignore codecov warnings: the PR contains a lot of tests - it should be enough, but they are disabled cause based on VCR.py cassettes that I'll add in a separate PR shortly once this PR is approved and merged.","created_at":"2016-12-14T16:43:22Z","updated_at":"2016-12-30T13:59:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ab4468f8e7fbd09d2fe5f76c09bad7fe30a214d","assignee":{"login":"chekunkov","id":744331,"avatar_url":"https://avatars.githubusercontent.com/u/744331?v=3","gravatar_id":"","url":"https://api.github.com/users/chekunkov","html_url":"https://github.com/chekunkov","followers_url":"https://api.github.com/users/chekunkov/followers","following_url":"https://api.github.com/users/chekunkov/following{/other_user}","gists_url":"https://api.github.com/users/chekunkov/gists{/gist_id}","starred_url":"https://api.github.com/users/chekunkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chekunkov/subscriptions","organizations_url":"https://api.github.com/users/chekunkov/orgs","repos_url":"https://api.github.com/users/chekunkov/repos","events_url":"https://api.github.com/users/chekunkov/events{/privacy}","received_events_url":"https://api.github.com/users/chekunkov/received_events","type":"User","site_admin":false},"assignees":[{"login":"chekunkov","id":744331,"avatar_url":"https://avatars.githubusercontent.com/u/744331?v=3","gravatar_id":"","url":"https://api.github.com/users/chekunkov","html_url":"https://github.com/chekunkov","followers_url":"https://api.github.com/users/chekunkov/followers","following_url":"https://api.github.com/users/chekunkov/following{/other_user}","gists_url":"https://api.github.com/users/chekunkov/gists{/gist_id}","starred_url":"https://api.github.com/users/chekunkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chekunkov/subscriptions","organizations_url":"https://api.github.com/users/chekunkov/orgs","repos_url":"https://api.github.com/users/chekunkov/repos","events_url":"https://api.github.com/users/chekunkov/events{/privacy}","received_events_url":"https://api.github.com/users/chekunkov/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38/commits","review_comments_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38/comments","review_comment_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/38/comments","statuses_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/statuses/9bbbc01800c80b06d95b1cc5378bcc8a897a412e","head":{"label":"scrapinghub:sc1467-1","ref":"sc1467-1","sha":"9bbbc01800c80b06d95b1cc5378bcc8a897a412e","user":{"login":"scrapinghub","id":699596,"avatar_url":"https://avatars.githubusercontent.com/u/699596?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapinghub","html_url":"https://github.com/scrapinghub","followers_url":"https://api.github.com/users/scrapinghub/followers","following_url":"https://api.github.com/users/scrapinghub/following{/other_user}","gists_url":"https://api.github.com/users/scrapinghub/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapinghub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapinghub/subscriptions","organizations_url":"https://api.github.com/users/scrapinghub/orgs","repos_url":"https://api.github.com/users/scrapinghub/repos","events_url":"https://api.github.com/users/scrapinghub/events{/privacy}","received_events_url":"https://api.github.com/users/scrapinghub/received_events","type":"Organization","site_admin":false},"repo":{"id":2211875,"name":"python-scrapinghub","full_name":"scrapinghub/python-scrapinghub","owner":{"login":"scrapinghub","id":699596,"avatar_url":"https://avatars.githubusercontent.com/u/699596?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapinghub","html_url":"https://github.com/scrapinghub","followers_url":"https://api.github.com/users/scrapinghub/followers","following_url":"https://api.github.com/users/scrapinghub/following{/other_user}","gists_url":"https://api.github.com/users/scrapinghub/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapinghub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapinghub/subscriptions","organizations_url":"https://api.github.com/users/scrapinghub/orgs","repos_url":"https://api.github.com/users/scrapinghub/repos","events_url":"https://api.github.com/users/scrapinghub/events{/privacy}","received_events_url":"https://api.github.com/users/scrapinghub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrapinghub/python-scrapinghub","description":"A client interface for Scrapinghub's API","fork":false,"url":"https://api.github.com/repos/scrapinghub/python-scrapinghub","forks_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/forks","keys_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/teams","hooks_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/hooks","issue_events_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/events{/number}","events_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/events","assignees_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/assignees{/user}","branches_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/branches{/branch}","tags_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/tags","blobs_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/statuses/{sha}","languages_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/languages","stargazers_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/stargazers","contributors_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/contributors","subscribers_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/subscribers","subscription_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/subscription","commits_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/contents/{+path}","compare_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/merges","archive_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/downloads","issues_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues{/number}","pulls_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls{/number}","milestones_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/milestones{/number}","notifications_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/labels{/name}","releases_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/releases{/id}","deployments_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/deployments","created_at":"2011-08-15T20:03:44Z","updated_at":"2016-12-19T21:28:24Z","pushed_at":"2016-12-30T13:49:51Z","git_url":"git://github.com/scrapinghub/python-scrapinghub.git","ssh_url":"git@github.com:scrapinghub/python-scrapinghub.git","clone_url":"https://github.com/scrapinghub/python-scrapinghub.git","svn_url":"https://github.com/scrapinghub/python-scrapinghub","homepage":"http://www.scrapinghub.com","size":947,"stargazers_count":63,"watchers_count":63,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":9,"forks":26,"open_issues":9,"watchers":63,"default_branch":"master"}},"base":{"label":"scrapinghub:master","ref":"master","sha":"48f59cf34970b8f1c6e304e21a37e8d00f699a87","user":{"login":"scrapinghub","id":699596,"avatar_url":"https://avatars.githubusercontent.com/u/699596?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapinghub","html_url":"https://github.com/scrapinghub","followers_url":"https://api.github.com/users/scrapinghub/followers","following_url":"https://api.github.com/users/scrapinghub/following{/other_user}","gists_url":"https://api.github.com/users/scrapinghub/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapinghub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapinghub/subscriptions","organizations_url":"https://api.github.com/users/scrapinghub/orgs","repos_url":"https://api.github.com/users/scrapinghub/repos","events_url":"https://api.github.com/users/scrapinghub/events{/privacy}","received_events_url":"https://api.github.com/users/scrapinghub/received_events","type":"Organization","site_admin":false},"repo":{"id":2211875,"name":"python-scrapinghub","full_name":"scrapinghub/python-scrapinghub","owner":{"login":"scrapinghub","id":699596,"avatar_url":"https://avatars.githubusercontent.com/u/699596?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapinghub","html_url":"https://github.com/scrapinghub","followers_url":"https://api.github.com/users/scrapinghub/followers","following_url":"https://api.github.com/users/scrapinghub/following{/other_user}","gists_url":"https://api.github.com/users/scrapinghub/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapinghub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapinghub/subscriptions","organizations_url":"https://api.github.com/users/scrapinghub/orgs","repos_url":"https://api.github.com/users/scrapinghub/repos","events_url":"https://api.github.com/users/scrapinghub/events{/privacy}","received_events_url":"https://api.github.com/users/scrapinghub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrapinghub/python-scrapinghub","description":"A client interface for Scrapinghub's API","fork":false,"url":"https://api.github.com/repos/scrapinghub/python-scrapinghub","forks_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/forks","keys_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/teams","hooks_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/hooks","issue_events_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/events{/number}","events_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/events","assignees_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/assignees{/user}","branches_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/branches{/branch}","tags_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/tags","blobs_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/statuses/{sha}","languages_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/languages","stargazers_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/stargazers","contributors_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/contributors","subscribers_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/subscribers","subscription_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/subscription","commits_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/contents/{+path}","compare_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/merges","archive_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/downloads","issues_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues{/number}","pulls_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls{/number}","milestones_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/milestones{/number}","notifications_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/labels{/name}","releases_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/releases{/id}","deployments_url":"https://api.github.com/repos/scrapinghub/python-scrapinghub/deployments","created_at":"2011-08-15T20:03:44Z","updated_at":"2016-12-19T21:28:24Z","pushed_at":"2016-12-30T13:49:51Z","git_url":"git://github.com/scrapinghub/python-scrapinghub.git","ssh_url":"git@github.com:scrapinghub/python-scrapinghub.git","clone_url":"https://github.com/scrapinghub/python-scrapinghub.git","svn_url":"https://github.com/scrapinghub/python-scrapinghub","homepage":"http://www.scrapinghub.com","size":947,"stargazers_count":63,"watchers_count":63,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":9,"forks":26,"open_issues":9,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38"},"html":{"href":"https://github.com/scrapinghub/python-scrapinghub/pull/38"},"issue":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/38"},"comments":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/scrapinghub/python-scrapinghub/statuses/9bbbc01800c80b06d95b1cc5378bcc8a897a412e"}}}}
{"actor":{"display_login":"chekunkov"}}