{"action":"created","comment":{"url":"https://api.github.com/repos/pulp/pulp/pulls/comments/85570084","pull_request_review_id":6280895,"id":85570084,"diff_hunk":"@@ -1,93 +1,44 @@\n import http.client\n \n-from pulp.common import error_codes\n-\n \n class PulpException(Exception):\n     \"\"\"\n     Base exception class for Pulp.\n-\n-    Provides base class __str__ and data_dict implementations\n     \"\"\"\n     http_status_code = http.client.INTERNAL_SERVER_ERROR\n \n-    def __init__(self, *args):\n-        super(PulpException, self).__init__(*args)\n-        self.error_code = error_codes.PLP0000\n-        self.error_data = {}\n-\n-        # child exceptions are those that are wrapped within this exception, validation errors\n-        # for example would have one overall validation error and then a separate sub error\n-        # for each validation that failed\n-\n-        self.child_exceptions = []\n-\n-    def add_child_exception(self, exception):\n-        self.child_exceptions.append(exception)\n-\n-    def to_dict(self):\n+    def __init__(self, error_code):\n         \"\"\"\n-        The to_dict method is used to provide a standardized dictionary\n-        of the exception information for usage storing to the database\n-        or converting to json to send back via an API call\n+        :param error_code: unique error code\n+        :type error_code: str\n         \"\"\"\n-        result = {\n-            'code': self.error_code.code,\n-            'description': str(self),\n-            'data': self.error_data,\n-            'sub_errors': []\n-        }\n-        for error in self.child_exceptions:\n-            if isinstance(error, PulpException):\n-                result['sub_errors'].append(error.to_dict())\n-            else:\n-                result['sub_errors'].append({'code': 'PLP0000',\n-                                             'description': str(error),\n-                                             'data': {},\n-                                             'sub_errors': []})\n-        return result\n-\n-    def __str__(self):\n-        class_name = self.__class__.__name__\n-        msg = _('Pulp exception occurred: %(c)s') % {'c': class_name}\n-        if self.args and isinstance(self.args[0], basestring):\n-            msg = self.args[0]\n-        return msg.encode('utf-8')\n-\n-    def data_dict(self):\n-        return {'args': self.args}\n-\n-\n-class PulpCodedException(PulpException):\n-    \"\"\"\n-    Base class for exceptions that put the error_code and data as init arguments\n-    \"\"\"\n-    def __init__(self, error_code=error_codes.PLP0001, **kwargs):\n-        super(PulpCodedException, self).__init__()\n+        if not isinstance(error_code, basestring):\n+            raise RuntimeError(\"Error code must be an instance of basestring.\")","path":"exceptions/pulp/exceptions/base.py","position":71,"original_position":71,"commit_id":"4be6f1ab3a2e060051241dd1c16f6cb86dd1bad8","original_commit_id":"4be6f1ab3a2e060051241dd1c16f6cb86dd1bad8","user":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"body":"Can this be i8ln?","created_at":"2016-10-28T17:00:43Z","updated_at":"2016-10-28T17:00:43Z","html_url":"https://github.com/pulp/pulp/pull/2807#discussion_r85570084","pull_request_url":"https://api.github.com/repos/pulp/pulp/pulls/2807","_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/85570084"},"html":{"href":"https://github.com/pulp/pulp/pull/2807#discussion_r85570084"},"pull_request":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2807"}}},"pull_request":{"url":"https://api.github.com/repos/pulp/pulp/pulls/2807","id":91249512,"html_url":"https://github.com/pulp/pulp/pull/2807","diff_url":"https://github.com/pulp/pulp/pull/2807.diff","patch_url":"https://github.com/pulp/pulp/pull/2807.patch","issue_url":"https://api.github.com/repos/pulp/pulp/issues/2807","number":2807,"state":"open","locked":false,"title":"Replaces PulpCodedException with PulpException","user":{"login":"dkliban","id":294339,"avatar_url":"https://avatars.githubusercontent.com/u/294339?v=3","gravatar_id":"","url":"https://api.github.com/users/dkliban","html_url":"https://github.com/dkliban","followers_url":"https://api.github.com/users/dkliban/followers","following_url":"https://api.github.com/users/dkliban/following{/other_user}","gists_url":"https://api.github.com/users/dkliban/gists{/gist_id}","starred_url":"https://api.github.com/users/dkliban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkliban/subscriptions","organizations_url":"https://api.github.com/users/dkliban/orgs","repos_url":"https://api.github.com/users/dkliban/repos","events_url":"https://api.github.com/users/dkliban/events{/privacy}","received_events_url":"https://api.github.com/users/dkliban/received_events","type":"User","site_admin":false},"body":"This commit also standardizes the format of the result field for failed Tasks.\r\n\r\ncloses #2271\r\nhttps://pulp.plan.io/issues/2271","created_at":"2016-10-27T17:52:21Z","updated_at":"2016-10-28T17:00:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ce918b467e891bbba3c72c1ce504a9d86c544e9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pulp/pulp/pulls/2807/commits","review_comments_url":"https://api.github.com/repos/pulp/pulp/pulls/2807/comments","review_comment_url":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pulp/pulp/issues/2807/comments","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/4be6f1ab3a2e060051241dd1c16f6cb86dd1bad8","head":{"label":"dkliban:exception-handling","ref":"exception-handling","sha":"4be6f1ab3a2e060051241dd1c16f6cb86dd1bad8","user":{"login":"dkliban","id":294339,"avatar_url":"https://avatars.githubusercontent.com/u/294339?v=3","gravatar_id":"","url":"https://api.github.com/users/dkliban","html_url":"https://github.com/dkliban","followers_url":"https://api.github.com/users/dkliban/followers","following_url":"https://api.github.com/users/dkliban/following{/other_user}","gists_url":"https://api.github.com/users/dkliban/gists{/gist_id}","starred_url":"https://api.github.com/users/dkliban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkliban/subscriptions","organizations_url":"https://api.github.com/users/dkliban/orgs","repos_url":"https://api.github.com/users/dkliban/repos","events_url":"https://api.github.com/users/dkliban/events{/privacy}","received_events_url":"https://api.github.com/users/dkliban/received_events","type":"User","site_admin":false},"repo":{"id":25177116,"name":"pulp","full_name":"dkliban/pulp","owner":{"login":"dkliban","id":294339,"avatar_url":"https://avatars.githubusercontent.com/u/294339?v=3","gravatar_id":"","url":"https://api.github.com/users/dkliban","html_url":"https://github.com/dkliban","followers_url":"https://api.github.com/users/dkliban/followers","following_url":"https://api.github.com/users/dkliban/following{/other_user}","gists_url":"https://api.github.com/users/dkliban/gists{/gist_id}","starred_url":"https://api.github.com/users/dkliban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkliban/subscriptions","organizations_url":"https://api.github.com/users/dkliban/orgs","repos_url":"https://api.github.com/users/dkliban/repos","events_url":"https://api.github.com/users/dkliban/events{/privacy}","received_events_url":"https://api.github.com/users/dkliban/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkliban/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":true,"url":"https://api.github.com/repos/dkliban/pulp","forks_url":"https://api.github.com/repos/dkliban/pulp/forks","keys_url":"https://api.github.com/repos/dkliban/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkliban/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkliban/pulp/teams","hooks_url":"https://api.github.com/repos/dkliban/pulp/hooks","issue_events_url":"https://api.github.com/repos/dkliban/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/dkliban/pulp/events","assignees_url":"https://api.github.com/repos/dkliban/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/dkliban/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/dkliban/pulp/tags","blobs_url":"https://api.github.com/repos/dkliban/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkliban/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkliban/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkliban/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkliban/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/dkliban/pulp/languages","stargazers_url":"https://api.github.com/repos/dkliban/pulp/stargazers","contributors_url":"https://api.github.com/repos/dkliban/pulp/contributors","subscribers_url":"https://api.github.com/repos/dkliban/pulp/subscribers","subscription_url":"https://api.github.com/repos/dkliban/pulp/subscription","commits_url":"https://api.github.com/repos/dkliban/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkliban/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkliban/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkliban/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dkliban/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/dkliban/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkliban/pulp/merges","archive_url":"https://api.github.com/repos/dkliban/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkliban/pulp/downloads","issues_url":"https://api.github.com/repos/dkliban/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/dkliban/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/dkliban/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/dkliban/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkliban/pulp/labels{/name}","releases_url":"https://api.github.com/repos/dkliban/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/dkliban/pulp/deployments","created_at":"2014-10-13T20:47:13Z","updated_at":"2015-04-03T14:29:06Z","pushed_at":"2016-10-28T14:46:16Z","git_url":"git://github.com/dkliban/pulp.git","ssh_url":"git@github.com:dkliban/pulp.git","clone_url":"https://github.com/dkliban/pulp.git","svn_url":"https://github.com/dkliban/pulp","homepage":"","size":93262,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"pulp:3.0-dev","ref":"3.0-dev","sha":"debd56c09cd6c618d15cd38136e9ee936a412568","user":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"repo":{"id":5314652,"name":"pulp","full_name":"pulp/pulp","owner":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pulp/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":false,"url":"https://api.github.com/repos/pulp/pulp","forks_url":"https://api.github.com/repos/pulp/pulp/forks","keys_url":"https://api.github.com/repos/pulp/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pulp/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pulp/pulp/teams","hooks_url":"https://api.github.com/repos/pulp/pulp/hooks","issue_events_url":"https://api.github.com/repos/pulp/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/pulp/pulp/events","assignees_url":"https://api.github.com/repos/pulp/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/pulp/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/pulp/pulp/tags","blobs_url":"https://api.github.com/repos/pulp/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pulp/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pulp/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pulp/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/pulp/pulp/languages","stargazers_url":"https://api.github.com/repos/pulp/pulp/stargazers","contributors_url":"https://api.github.com/repos/pulp/pulp/contributors","subscribers_url":"https://api.github.com/repos/pulp/pulp/subscribers","subscription_url":"https://api.github.com/repos/pulp/pulp/subscription","commits_url":"https://api.github.com/repos/pulp/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pulp/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pulp/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pulp/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pulp/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/pulp/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pulp/pulp/merges","archive_url":"https://api.github.com/repos/pulp/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pulp/pulp/downloads","issues_url":"https://api.github.com/repos/pulp/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/pulp/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/pulp/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/pulp/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pulp/pulp/labels{/name}","releases_url":"https://api.github.com/repos/pulp/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/pulp/pulp/deployments","created_at":"2012-08-06T13:49:20Z","updated_at":"2016-10-25T20:01:30Z","pushed_at":"2016-10-28T14:46:17Z","git_url":"git://github.com/pulp/pulp.git","ssh_url":"git@github.com:pulp/pulp.git","clone_url":"https://github.com/pulp/pulp.git","svn_url":"https://github.com/pulp/pulp","homepage":"","size":103243,"stargazers_count":286,"watchers_count":286,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":16,"forks":112,"open_issues":16,"watchers":286,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2807"},"html":{"href":"https://github.com/pulp/pulp/pull/2807"},"issue":{"href":"https://api.github.com/repos/pulp/pulp/issues/2807"},"comments":{"href":"https://api.github.com/repos/pulp/pulp/issues/2807/comments"},"review_comments":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2807/comments"},"review_comment":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2807/commits"},"statuses":{"href":"https://api.github.com/repos/pulp/pulp/statuses/4be6f1ab3a2e060051241dd1c16f6cb86dd1bad8"}}}}
{"actor":{"display_login":"bmbouter"}}