{"action":"created","comment":{"url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/comments/41193753","id":41193753,"diff_hunk":"@@ -65,10 +78,10 @@ def submit_low_level(mbid):\n     try:\n         data = json.loads(raw_data.decode(\"utf-8\"))\n     except ValueError as e:\n-        raise BadRequest(\"Cannot parse JSON document: %s\" % e)\n+        raise webserver.exceptions.InvalidAPIUsage(\"Cannot parse JSON document: %s\" % e, status_code=BadRequest.code)\n \n     try:\n         submit_low_level_data(mbid, data)\n     except BadDataException as e:\n-        raise BadRequest(e)\n-    return \"\"\n+        raise webserver.exceptions.InvalidAPIUsage(\"%s\" % e, status_code=BadRequest.code)\n+    return jsonify({\"status\": \"ok\"})","path":"webserver/views/api.py","position":69,"original_position":69,"commit_id":"c84b02de6f5abb48be26d8144260b51beac49158","original_commit_id":"c84b02de6f5abb48be26d8144260b51beac49158","user":{"login":"gentlecat","id":460525,"avatar_url":"https://avatars.githubusercontent.com/u/460525?v=3","gravatar_id":"","url":"https://api.github.com/users/gentlecat","html_url":"https://github.com/gentlecat","followers_url":"https://api.github.com/users/gentlecat/followers","following_url":"https://api.github.com/users/gentlecat/following{/other_user}","gists_url":"https://api.github.com/users/gentlecat/gists{/gist_id}","starred_url":"https://api.github.com/users/gentlecat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gentlecat/subscriptions","organizations_url":"https://api.github.com/users/gentlecat/orgs","repos_url":"https://api.github.com/users/gentlecat/repos","events_url":"https://api.github.com/users/gentlecat/events{/privacy}","received_events_url":"https://api.github.com/users/gentlecat/received_events","type":"User","site_admin":false},"body":":+1:","created_at":"2015-10-05T20:33:29Z","updated_at":"2015-10-05T20:33:29Z","html_url":"https://github.com/metabrainz/acousticbrainz-server/pull/140#discussion_r41193753","pull_request_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140","_links":{"self":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/comments/41193753"},"html":{"href":"https://github.com/metabrainz/acousticbrainz-server/pull/140#discussion_r41193753"},"pull_request":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140"}}},"pull_request":{"url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140","id":46802388,"html_url":"https://github.com/metabrainz/acousticbrainz-server/pull/140","diff_url":"https://github.com/metabrainz/acousticbrainz-server/pull/140.diff","patch_url":"https://github.com/metabrainz/acousticbrainz-server/pull/140.patch","issue_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/140","number":140,"state":"open","locked":false,"title":"AB-90: Return a json error message for API endpoints","user":{"login":"alastair","id":19217,"avatar_url":"https://avatars.githubusercontent.com/u/19217?v=3","gravatar_id":"","url":"https://api.github.com/users/alastair","html_url":"https://github.com/alastair","followers_url":"https://api.github.com/users/alastair/followers","following_url":"https://api.github.com/users/alastair/following{/other_user}","gists_url":"https://api.github.com/users/alastair/gists{/gist_id}","starred_url":"https://api.github.com/users/alastair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alastair/subscriptions","organizations_url":"https://api.github.com/users/alastair/orgs","repos_url":"https://api.github.com/users/alastair/repos","events_url":"https://api.github.com/users/alastair/events{/privacy}","received_events_url":"https://api.github.com/users/alastair/received_events","type":"User","site_admin":false},"body":"Fixes AB-90: http://tickets.musicbrainz.org/browse/AB-90\r\nWe use a flask pattern from\r\nhttp://flask.pocoo.org/docs/0.10/patterns/apierrors/\r\nto raise a specific api error and return a json response in the\r\nerror handler.\r\nWe add two more routes to catch /anything/low-level and .../high-level\r\nso that we can also return json for invalid uuids, not just missing\r\nones.","created_at":"2015-10-05T16:25:13Z","updated_at":"2015-10-05T20:33:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82c423d5b2e4d480e973ecfbe4edbda34a1d1ad3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140/commits","review_comments_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140/comments","review_comment_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/140/comments","statuses_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/statuses/c84b02de6f5abb48be26d8144260b51beac49158","head":{"label":"metabrainz:apierror","ref":"apierror","sha":"c84b02de6f5abb48be26d8144260b51beac49158","user":{"login":"metabrainz","id":293421,"avatar_url":"https://avatars.githubusercontent.com/u/293421?v=3","gravatar_id":"","url":"https://api.github.com/users/metabrainz","html_url":"https://github.com/metabrainz","followers_url":"https://api.github.com/users/metabrainz/followers","following_url":"https://api.github.com/users/metabrainz/following{/other_user}","gists_url":"https://api.github.com/users/metabrainz/gists{/gist_id}","starred_url":"https://api.github.com/users/metabrainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabrainz/subscriptions","organizations_url":"https://api.github.com/users/metabrainz/orgs","repos_url":"https://api.github.com/users/metabrainz/repos","events_url":"https://api.github.com/users/metabrainz/events{/privacy}","received_events_url":"https://api.github.com/users/metabrainz/received_events","type":"Organization","site_admin":false},"repo":{"id":24893738,"name":"acousticbrainz-server","full_name":"metabrainz/acousticbrainz-server","owner":{"login":"metabrainz","id":293421,"avatar_url":"https://avatars.githubusercontent.com/u/293421?v=3","gravatar_id":"","url":"https://api.github.com/users/metabrainz","html_url":"https://github.com/metabrainz","followers_url":"https://api.github.com/users/metabrainz/followers","following_url":"https://api.github.com/users/metabrainz/following{/other_user}","gists_url":"https://api.github.com/users/metabrainz/gists{/gist_id}","starred_url":"https://api.github.com/users/metabrainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabrainz/subscriptions","organizations_url":"https://api.github.com/users/metabrainz/orgs","repos_url":"https://api.github.com/users/metabrainz/repos","events_url":"https://api.github.com/users/metabrainz/events{/privacy}","received_events_url":"https://api.github.com/users/metabrainz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metabrainz/acousticbrainz-server","description":"The server components for the new AcousticBrainz project.","fork":false,"url":"https://api.github.com/repos/metabrainz/acousticbrainz-server","forks_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/forks","keys_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/teams","hooks_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/hooks","issue_events_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/events{/number}","events_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/events","assignees_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/assignees{/user}","branches_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/branches{/branch}","tags_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/tags","blobs_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/statuses/{sha}","languages_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/languages","stargazers_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/stargazers","contributors_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/contributors","subscribers_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/subscribers","subscription_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/subscription","commits_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/contents/{+path}","compare_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/merges","archive_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/downloads","issues_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues{/number}","pulls_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls{/number}","milestones_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/milestones{/number}","notifications_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/labels{/name}","releases_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/releases{/id}","created_at":"2014-10-07T14:22:44Z","updated_at":"2015-09-14T19:10:00Z","pushed_at":"2015-10-05T16:25:13Z","git_url":"git://github.com/metabrainz/acousticbrainz-server.git","ssh_url":"git@github.com:metabrainz/acousticbrainz-server.git","clone_url":"https://github.com/metabrainz/acousticbrainz-server.git","svn_url":"https://github.com/metabrainz/acousticbrainz-server","homepage":"http://acousticbrainz.org/","size":3322,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":16,"forks":7,"open_issues":16,"watchers":27,"default_branch":"master"}},"base":{"label":"metabrainz:master","ref":"master","sha":"a2d1653cb6bf8c52a7eea685e79fa44d4edaff56","user":{"login":"metabrainz","id":293421,"avatar_url":"https://avatars.githubusercontent.com/u/293421?v=3","gravatar_id":"","url":"https://api.github.com/users/metabrainz","html_url":"https://github.com/metabrainz","followers_url":"https://api.github.com/users/metabrainz/followers","following_url":"https://api.github.com/users/metabrainz/following{/other_user}","gists_url":"https://api.github.com/users/metabrainz/gists{/gist_id}","starred_url":"https://api.github.com/users/metabrainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabrainz/subscriptions","organizations_url":"https://api.github.com/users/metabrainz/orgs","repos_url":"https://api.github.com/users/metabrainz/repos","events_url":"https://api.github.com/users/metabrainz/events{/privacy}","received_events_url":"https://api.github.com/users/metabrainz/received_events","type":"Organization","site_admin":false},"repo":{"id":24893738,"name":"acousticbrainz-server","full_name":"metabrainz/acousticbrainz-server","owner":{"login":"metabrainz","id":293421,"avatar_url":"https://avatars.githubusercontent.com/u/293421?v=3","gravatar_id":"","url":"https://api.github.com/users/metabrainz","html_url":"https://github.com/metabrainz","followers_url":"https://api.github.com/users/metabrainz/followers","following_url":"https://api.github.com/users/metabrainz/following{/other_user}","gists_url":"https://api.github.com/users/metabrainz/gists{/gist_id}","starred_url":"https://api.github.com/users/metabrainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabrainz/subscriptions","organizations_url":"https://api.github.com/users/metabrainz/orgs","repos_url":"https://api.github.com/users/metabrainz/repos","events_url":"https://api.github.com/users/metabrainz/events{/privacy}","received_events_url":"https://api.github.com/users/metabrainz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metabrainz/acousticbrainz-server","description":"The server components for the new AcousticBrainz project.","fork":false,"url":"https://api.github.com/repos/metabrainz/acousticbrainz-server","forks_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/forks","keys_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/teams","hooks_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/hooks","issue_events_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/events{/number}","events_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/events","assignees_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/assignees{/user}","branches_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/branches{/branch}","tags_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/tags","blobs_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/statuses/{sha}","languages_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/languages","stargazers_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/stargazers","contributors_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/contributors","subscribers_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/subscribers","subscription_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/subscription","commits_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/contents/{+path}","compare_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/merges","archive_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/downloads","issues_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues{/number}","pulls_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls{/number}","milestones_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/milestones{/number}","notifications_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/labels{/name}","releases_url":"https://api.github.com/repos/metabrainz/acousticbrainz-server/releases{/id}","created_at":"2014-10-07T14:22:44Z","updated_at":"2015-09-14T19:10:00Z","pushed_at":"2015-10-05T16:25:13Z","git_url":"git://github.com/metabrainz/acousticbrainz-server.git","ssh_url":"git@github.com:metabrainz/acousticbrainz-server.git","clone_url":"https://github.com/metabrainz/acousticbrainz-server.git","svn_url":"https://github.com/metabrainz/acousticbrainz-server","homepage":"http://acousticbrainz.org/","size":3322,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":16,"forks":7,"open_issues":16,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140"},"html":{"href":"https://github.com/metabrainz/acousticbrainz-server/pull/140"},"issue":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/140"},"comments":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/issues/140/comments"},"review_comments":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140/comments"},"review_comment":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/pulls/140/commits"},"statuses":{"href":"https://api.github.com/repos/metabrainz/acousticbrainz-server/statuses/c84b02de6f5abb48be26d8144260b51beac49158"}}}}