{"action":"created","issue":{"url":"https://api.github.com/repos/oppia/oppia/issues/1160","repository_url":"https://api.github.com/repos/oppia/oppia","labels_url":"https://api.github.com/repos/oppia/oppia/issues/1160/labels{/name}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/1160/comments","events_url":"https://api.github.com/repos/oppia/oppia/issues/1160/events","html_url":"https://github.com/oppia/oppia/issues/1160","id":118574498,"number":1160,"title":"Fix get() handlers which usually return json objects to do so even if there's some kind of error","user":{"login":"sbhowmik89","id":8260362,"avatar_url":"https://avatars.githubusercontent.com/u/8260362?v=3","gravatar_id":"","url":"https://api.github.com/users/sbhowmik89","html_url":"https://github.com/sbhowmik89","followers_url":"https://api.github.com/users/sbhowmik89/followers","following_url":"https://api.github.com/users/sbhowmik89/following{/other_user}","gists_url":"https://api.github.com/users/sbhowmik89/gists{/gist_id}","starred_url":"https://api.github.com/users/sbhowmik89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbhowmik89/subscriptions","organizations_url":"https://api.github.com/users/sbhowmik89/orgs","repos_url":"https://api.github.com/users/sbhowmik89/repos","events_url":"https://api.github.com/users/sbhowmik89/events{/privacy}","received_events_url":"https://api.github.com/users/sbhowmik89/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/oppia/oppia/labels/bug:%20major","name":"bug: major","color":"fbca04"},{"url":"https://api.github.com/repos/oppia/oppia/labels/general/refactoring-and-cleanup","name":"general/refactoring-and-cleanup","color":"eeeeee"},{"url":"https://api.github.com/repos/oppia/oppia/labels/TODO:%20tech%20(design%20doc)","name":"TODO: tech (design doc)","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"dpaparis","id":6433828,"avatar_url":"https://avatars.githubusercontent.com/u/6433828?v=3","gravatar_id":"","url":"https://api.github.com/users/dpaparis","html_url":"https://github.com/dpaparis","followers_url":"https://api.github.com/users/dpaparis/followers","following_url":"https://api.github.com/users/dpaparis/following{/other_user}","gists_url":"https://api.github.com/users/dpaparis/gists{/gist_id}","starred_url":"https://api.github.com/users/dpaparis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpaparis/subscriptions","organizations_url":"https://api.github.com/users/dpaparis/orgs","repos_url":"https://api.github.com/users/dpaparis/repos","events_url":"https://api.github.com/users/dpaparis/events{/privacy}","received_events_url":"https://api.github.com/users/dpaparis/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-11-24T10:16:36Z","updated_at":"2016-04-01T07:31:44Z","closed_at":null,"body":"How to reproduce: Use testapp.get() with expect_errors=True . It won't return a JSON object. The GET handlers need better error management and should start returning JSON object irrespective of the presence of errors."},"comment":{"url":"https://api.github.com/repos/oppia/oppia/issues/comments/204290541","html_url":"https://github.com/oppia/oppia/issues/1160#issuecomment-204290541","issue_url":"https://api.github.com/repos/oppia/oppia/issues/1160","id":204290541,"user":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T07:31:44Z","updated_at":"2016-04-01T07:31:44Z","body":"Also, just to clarify: the issue here is that get_json() in core/tests/test_utils.py does not work properly in the case where the GET request results in an error. The aim is to fix this, so that the get_json method can be treated similarly to post_json and put_json in the same file (i.e., it should be possible to pass expect_errors, expected_status_int to it).\r\n\r\nA good way to try and reproduce this is to go to core.controllers.galleries_test, find a get_json() call, and modify the backend to raise an error of some kind. Add a logging call to get_json() in test_utils.py, and look at what is returned in json_response -- it doesn't contain a json object, as would be expected."}}