{"action":"created","comment":{"url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments/65819363","id":65819363,"diff_hunk":"@@ -0,0 +1,75 @@\n+class WikipediabaseException(Exception):\n+    \"\"\"\n+    Base class for all Wikipediabase exceptions.\n+    \"\"\"\n+    def __init__(self, message=None, reply=None):\n+        super(WikipediabaseException, self).__init__()\n+        self.message = message\n+        self.reply = reply\n+\n+\n+class BadRequestFormat(WikipediabaseException):\n+    \"\"\"\n+    The request string is ill-formed.\n+    \"\"\"\n+    pass\n+\n+\n+class IllegalRequest(WikipediabaseException):\n+    \"\"\"\n+    The request calls functions with wrong argument(s).\n+    \"\"\"\n+    pass\n+\n+\n+class FunctionNotFound(WikipediabaseException):\n+    \"\"\"\n+    The request calls a function that doesn't exist in knowledge base.","path":"wikipediabase/exceptions.py","position":27,"original_position":27,"commit_id":"4f1134969b770ec2420dabf26ebe7b878373759d","original_commit_id":"4f1134969b770ec2420dabf26ebe7b878373759d","user":{"login":"michaelsilver","id":5913522,"avatar_url":"https://avatars.githubusercontent.com/u/5913522?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsilver","html_url":"https://github.com/michaelsilver","followers_url":"https://api.github.com/users/michaelsilver/followers","following_url":"https://api.github.com/users/michaelsilver/following{/other_user}","gists_url":"https://api.github.com/users/michaelsilver/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsilver/subscriptions","organizations_url":"https://api.github.com/users/michaelsilver/orgs","repos_url":"https://api.github.com/users/michaelsilver/repos","events_url":"https://api.github.com/users/michaelsilver/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsilver/received_events","type":"User","site_admin":false},"body":"Grammar: either say `in knowledgebase.py` if you are referring to the file or `in the knowledge base` if in the abstract. I'd prefer the latter in the case code gets refactored in the future and `knowledgebase.py` ceases to exist (not very likely, but still).","created_at":"2016-06-05T15:34:57Z","updated_at":"2016-06-05T15:34:57Z","html_url":"https://github.com/infolab-csail/WikipediaBase/pull/233#discussion_r65819363","pull_request_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233","_links":{"self":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments/65819363"},"html":{"href":"https://github.com/infolab-csail/WikipediaBase/pull/233#discussion_r65819363"},"pull_request":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233"}}},"pull_request":{"url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233","id":72569192,"html_url":"https://github.com/infolab-csail/WikipediaBase/pull/233","diff_url":"https://github.com/infolab-csail/WikipediaBase/pull/233.diff","patch_url":"https://github.com/infolab-csail/WikipediaBase/pull/233.patch","issue_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/233","number":233,"state":"open","locked":false,"title":"Improve error handling","user":{"login":"chsamlee","id":4664430,"avatar_url":"https://avatars.githubusercontent.com/u/4664430?v=3","gravatar_id":"","url":"https://api.github.com/users/chsamlee","html_url":"https://github.com/chsamlee","followers_url":"https://api.github.com/users/chsamlee/followers","following_url":"https://api.github.com/users/chsamlee/following{/other_user}","gists_url":"https://api.github.com/users/chsamlee/gists{/gist_id}","starred_url":"https://api.github.com/users/chsamlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chsamlee/subscriptions","organizations_url":"https://api.github.com/users/chsamlee/orgs","repos_url":"https://api.github.com/users/chsamlee/repos","events_url":"https://api.github.com/users/chsamlee/events{/privacy}","received_events_url":"https://api.github.com/users/chsamlee/received_events","type":"User","site_admin":false},"body":"Changes:\r\n- ability to return empty list\r\n- exceptions within Wikipediabase are now raised instead of returned as objects\r\n- all exceptions are properly lispified\r\n- exceptions are raised when:\r\n  - Already present in v1.3.0:\r\n    - query's parentheses are not balanced (`bad-request-format`)\r\n    - query is empty (`illegal-request`, used to be `bad-request-format`)\r\n    - image resource cannot be found (`resource-not-found`)\r\n    - attribute cannot be found (`attribute-not-found`)\r\n    - cannot determine value of attribute (`attribute-value-not-found`) (e.g. asking about `death-place` of a person who is still alive)\r\n  - New in this PR:\r\n    - query calls a nonexistent function (`function-not-found`)\r\n    - query calls function with incorrect parameters (wrong type or wrong number of args) (`illegal-request`)\r\n    - query asks about a symbol that doesn't exist (`symbol-not-found`)\r\n    - the symbol specified by query does not belong to the given class (`class-not-found`)\r\n    - for `get`, the query does not include `:code` or `:rendered` attribute (`illegal-request`)\r\n    - query includes an invalid option (`illegal-request`, used to be `bad-request-format` for some resolvers) (e.g. `(:markup \"foo\")`, `(:width 0)`)\r\n- if Wikipediabase encounters an unhandled exception, a `wikipediabase-internal-error` object is returned\r\n\r\nResolves #82 and fixes #204.","created_at":"2016-06-03T20:59:23Z","updated_at":"2016-06-05T15:34:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d74ce6fd2828c71c6e906cce791933053396c8c0","assignee":{"login":"michaelsilver","id":5913522,"avatar_url":"https://avatars.githubusercontent.com/u/5913522?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsilver","html_url":"https://github.com/michaelsilver","followers_url":"https://api.github.com/users/michaelsilver/followers","following_url":"https://api.github.com/users/michaelsilver/following{/other_user}","gists_url":"https://api.github.com/users/michaelsilver/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsilver/subscriptions","organizations_url":"https://api.github.com/users/michaelsilver/orgs","repos_url":"https://api.github.com/users/michaelsilver/repos","events_url":"https://api.github.com/users/michaelsilver/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsilver/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233/commits","review_comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233/comments","review_comment_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/233/comments","statuses_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/4f1134969b770ec2420dabf26ebe7b878373759d","head":{"label":"infolab-csail:error-handling","ref":"error-handling","sha":"4f1134969b770ec2420dabf26ebe7b878373759d","user":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"repo":{"id":15544139,"name":"WikipediaBase","full_name":"infolab-csail/WikipediaBase","owner":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infolab-csail/WikipediaBase","description":"Wikipedia interaction with start.mit.edu","fork":false,"url":"https://api.github.com/repos/infolab-csail/WikipediaBase","forks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/forks","keys_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/teams","hooks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/hooks","issue_events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/events{/number}","events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/events","assignees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/assignees{/user}","branches_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/branches{/branch}","tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/tags","blobs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/refs{/sha}","trees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/{sha}","languages_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/languages","stargazers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/stargazers","contributors_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contributors","subscribers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscribers","subscription_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscription","commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/commits{/sha}","git_commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/commits{/sha}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/comments{/number}","issue_comment_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/comments{/number}","contents_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contents/{+path}","compare_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/merges","archive_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/downloads","issues_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues{/number}","pulls_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls{/number}","milestones_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/milestones{/number}","notifications_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/labels{/name}","releases_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/releases{/id}","deployments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/deployments","created_at":"2013-12-31T06:02:34Z","updated_at":"2016-01-13T23:13:10Z","pushed_at":"2016-06-03T22:18:24Z","git_url":"git://github.com/infolab-csail/WikipediaBase.git","ssh_url":"git@github.com:infolab-csail/WikipediaBase.git","clone_url":"https://github.com/infolab-csail/WikipediaBase.git","svn_url":"https://github.com/infolab-csail/WikipediaBase","homepage":null,"size":9038,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":25,"forks":1,"open_issues":25,"watchers":0,"default_branch":"master"}},"base":{"label":"infolab-csail:master","ref":"master","sha":"89d93e44bd043e68bd4ea1801789c1ae63df36df","user":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"repo":{"id":15544139,"name":"WikipediaBase","full_name":"infolab-csail/WikipediaBase","owner":{"login":"infolab-csail","id":13588310,"avatar_url":"https://avatars.githubusercontent.com/u/13588310?v=3","gravatar_id":"","url":"https://api.github.com/users/infolab-csail","html_url":"https://github.com/infolab-csail","followers_url":"https://api.github.com/users/infolab-csail/followers","following_url":"https://api.github.com/users/infolab-csail/following{/other_user}","gists_url":"https://api.github.com/users/infolab-csail/gists{/gist_id}","starred_url":"https://api.github.com/users/infolab-csail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infolab-csail/subscriptions","organizations_url":"https://api.github.com/users/infolab-csail/orgs","repos_url":"https://api.github.com/users/infolab-csail/repos","events_url":"https://api.github.com/users/infolab-csail/events{/privacy}","received_events_url":"https://api.github.com/users/infolab-csail/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infolab-csail/WikipediaBase","description":"Wikipedia interaction with start.mit.edu","fork":false,"url":"https://api.github.com/repos/infolab-csail/WikipediaBase","forks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/forks","keys_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/teams","hooks_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/hooks","issue_events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/events{/number}","events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/events","assignees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/assignees{/user}","branches_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/branches{/branch}","tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/tags","blobs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/refs{/sha}","trees_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/{sha}","languages_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/languages","stargazers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/stargazers","contributors_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contributors","subscribers_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscribers","subscription_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/subscription","commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/commits{/sha}","git_commits_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/git/commits{/sha}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/comments{/number}","issue_comment_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/comments{/number}","contents_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/contents/{+path}","compare_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/merges","archive_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/downloads","issues_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues{/number}","pulls_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls{/number}","milestones_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/milestones{/number}","notifications_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/labels{/name}","releases_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/releases{/id}","deployments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/deployments","created_at":"2013-12-31T06:02:34Z","updated_at":"2016-01-13T23:13:10Z","pushed_at":"2016-06-03T22:18:24Z","git_url":"git://github.com/infolab-csail/WikipediaBase.git","ssh_url":"git@github.com:infolab-csail/WikipediaBase.git","clone_url":"https://github.com/infolab-csail/WikipediaBase.git","svn_url":"https://github.com/infolab-csail/WikipediaBase","homepage":null,"size":9038,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":25,"forks":1,"open_issues":25,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233"},"html":{"href":"https://github.com/infolab-csail/WikipediaBase/pull/233"},"issue":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/233"},"comments":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/233/comments"},"review_comments":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233/comments"},"review_comment":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/pulls/233/commits"},"statuses":{"href":"https://api.github.com/repos/infolab-csail/WikipediaBase/statuses/4f1134969b770ec2420dabf26ebe7b878373759d"}}}}
{"actor":{"display_login":"michaelsilver"}}