{"action":"created","comment":{"url":"https://api.github.com/repos/edx/XBlock/pulls/comments/42662892","id":42662892,"diff_hunk":"@@ -30,8 +30,9 @@ def __init__(self, saved_fields, dirty_fields):\n         `dirty_fields` - a set of fields that were left dirty after the save\n         \"\"\"\n         # Exception is an old-style class, so can't use super\n-        Exception.__init__(self)\n+        Exception.__init__(self, message)","path":"xblock/exceptions.py","position":14,"original_position":14,"commit_id":"03b0f11be19eb489ec57ea70b94faf562f277037","original_commit_id":"03b0f11be19eb489ec57ea70b94faf562f277037","user":{"login":"adampalay","id":2748698,"avatar_url":"https://avatars.githubusercontent.com/u/2748698?v=3","gravatar_id":"","url":"https://api.github.com/users/adampalay","html_url":"https://github.com/adampalay","followers_url":"https://api.github.com/users/adampalay/followers","following_url":"https://api.github.com/users/adampalay/following{/other_user}","gists_url":"https://api.github.com/users/adampalay/gists{/gist_id}","starred_url":"https://api.github.com/users/adampalay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adampalay/subscriptions","organizations_url":"https://api.github.com/users/adampalay/orgs","repos_url":"https://api.github.com/users/adampalay/repos","events_url":"https://api.github.com/users/adampalay/events{/privacy}","received_events_url":"https://api.github.com/users/adampalay/received_events","type":"User","site_admin":false},"body":"sorry, still unclear why we're passing `message` here","created_at":"2015-10-21T18:27:10Z","updated_at":"2015-10-21T18:27:10Z","html_url":"https://github.com/edx/XBlock/pull/323#discussion_r42662892","pull_request_url":"https://api.github.com/repos/edx/XBlock/pulls/323","_links":{"self":{"href":"https://api.github.com/repos/edx/XBlock/pulls/comments/42662892"},"html":{"href":"https://github.com/edx/XBlock/pull/323#discussion_r42662892"},"pull_request":{"href":"https://api.github.com/repos/edx/XBlock/pulls/323"}}},"pull_request":{"url":"https://api.github.com/repos/edx/XBlock/pulls/323","id":48205063,"html_url":"https://github.com/edx/XBlock/pull/323","diff_url":"https://github.com/edx/XBlock/pull/323.diff","patch_url":"https://github.com/edx/XBlock/pull/323.patch","issue_url":"https://api.github.com/repos/edx/XBlock/issues/323","number":323,"state":"open","locked":false,"title":"Adding message in XBlockSaveError Exception","user":{"login":"awaisdar001","id":4252738,"avatar_url":"https://avatars.githubusercontent.com/u/4252738?v=3","gravatar_id":"","url":"https://api.github.com/users/awaisdar001","html_url":"https://github.com/awaisdar001","followers_url":"https://api.github.com/users/awaisdar001/followers","following_url":"https://api.github.com/users/awaisdar001/following{/other_user}","gists_url":"https://api.github.com/users/awaisdar001/gists{/gist_id}","starred_url":"https://api.github.com/users/awaisdar001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awaisdar001/subscriptions","organizations_url":"https://api.github.com/users/awaisdar001/orgs","repos_url":"https://api.github.com/users/awaisdar001/repos","events_url":"https://api.github.com/users/awaisdar001/events{/privacy}","received_events_url":"https://api.github.com/users/awaisdar001/received_events","type":"User","site_admin":false},"body":"[TNL-2324](https://openedx.atlassian.net/browse/TNL-2324)\r\n\r\nAdding message in `XBlockSaveError` excception. Current exception in [mixins.py#L275](https://github.com/edx/XBlock/blob/111935cab69a9128948180e6b9673c391d2ff165/xblock/mixins.py#L275) doesn't log the fields on which the error is occurring. \r\n\r\n#### Example of current logging of exception\r\n```\r\nTraceback (most recent call last):\r\nFile \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/hooks/framework_django.py\", line 499, in wrapper return wrapped(*args, **kwargs)\r\nFile \"/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py\", line 945, in handle_xblock_callback return _invoke_xblock_handler(request, course_id, usage_id, handler, suffix, course=course)\r\nFile \"/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py\", line 1064, in _invoke_xblock_handler resp = instance.handle(handler, req, suffix)\r\nFile \"/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/mixins.py\", line 86, in handle return self.runtime.handle(self, handler_name, request, suffix)\r\nFile \"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py\", line 1274, in handle return super(MetricsMixin, self).handle(block, handler_name, request, suffix=suffix)\r\nFile \"/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py\", line 1035, in handle block.save()\r\nFile \"/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/mixins.py\", line 253, in save self.force_save_fields(fields_to_save)\r\nFile \"/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/mixins.py\", line 275, in force_save_fields raise XBlockSaveError(saved_fields, fields)\r\nXBlockSaveError\r\n```\r\n\r\n#### Example of logging after change\r\n```\r\n    self.force_save_fields(fields_to_save)\r\n  File \"/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/mixins.py\", line 277, in force_save_fields\r\n    raise XBlockSaveError(saved_fields, fields, msg)\r\nXBlockSaveError: Error saving fields ['error_field']\r\n```","created_at":"2015-10-20T14:05:20Z","updated_at":"2015-10-21T18:27:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3917028bf8bcf59988953b5ef3b78e582ae805bb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/XBlock/pulls/323/commits","review_comments_url":"https://api.github.com/repos/edx/XBlock/pulls/323/comments","review_comment_url":"https://api.github.com/repos/edx/XBlock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/XBlock/issues/323/comments","statuses_url":"https://api.github.com/repos/edx/XBlock/statuses/03b0f11be19eb489ec57ea70b94faf562f277037","head":{"label":"edx:aj/tnl2324-add-log-in-xblocksaveerror-exception","ref":"aj/tnl2324-add-log-in-xblocksaveerror-exception","sha":"03b0f11be19eb489ec57ea70b94faf562f277037","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":8710321,"name":"XBlock","full_name":"edx/XBlock","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/XBlock","description":"XBlock courseware component architecture","fork":false,"url":"https://api.github.com/repos/edx/XBlock","forks_url":"https://api.github.com/repos/edx/XBlock/forks","keys_url":"https://api.github.com/repos/edx/XBlock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/XBlock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/XBlock/teams","hooks_url":"https://api.github.com/repos/edx/XBlock/hooks","issue_events_url":"https://api.github.com/repos/edx/XBlock/issues/events{/number}","events_url":"https://api.github.com/repos/edx/XBlock/events","assignees_url":"https://api.github.com/repos/edx/XBlock/assignees{/user}","branches_url":"https://api.github.com/repos/edx/XBlock/branches{/branch}","tags_url":"https://api.github.com/repos/edx/XBlock/tags","blobs_url":"https://api.github.com/repos/edx/XBlock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/XBlock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/XBlock/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/XBlock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/XBlock/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/XBlock/languages","stargazers_url":"https://api.github.com/repos/edx/XBlock/stargazers","contributors_url":"https://api.github.com/repos/edx/XBlock/contributors","subscribers_url":"https://api.github.com/repos/edx/XBlock/subscribers","subscription_url":"https://api.github.com/repos/edx/XBlock/subscription","commits_url":"https://api.github.com/repos/edx/XBlock/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/XBlock/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/XBlock/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/XBlock/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/XBlock/contents/{+path}","compare_url":"https://api.github.com/repos/edx/XBlock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/XBlock/merges","archive_url":"https://api.github.com/repos/edx/XBlock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/XBlock/downloads","issues_url":"https://api.github.com/repos/edx/XBlock/issues{/number}","pulls_url":"https://api.github.com/repos/edx/XBlock/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/XBlock/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/XBlock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/XBlock/labels{/name}","releases_url":"https://api.github.com/repos/edx/XBlock/releases{/id}","created_at":"2013-03-11T18:35:36Z","updated_at":"2015-10-21T08:54:20Z","pushed_at":"2015-10-21T18:21:48Z","git_url":"git://github.com/edx/XBlock.git","ssh_url":"git@github.com:edx/XBlock.git","clone_url":"https://github.com/edx/XBlock.git","svn_url":"https://github.com/edx/XBlock","homepage":null,"size":6988,"stargazers_count":389,"watchers_count":389,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":193,"mirror_url":null,"open_issues_count":29,"forks":193,"open_issues":29,"watchers":389,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"111935cab69a9128948180e6b9673c391d2ff165","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":8710321,"name":"XBlock","full_name":"edx/XBlock","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/XBlock","description":"XBlock courseware component architecture","fork":false,"url":"https://api.github.com/repos/edx/XBlock","forks_url":"https://api.github.com/repos/edx/XBlock/forks","keys_url":"https://api.github.com/repos/edx/XBlock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/XBlock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/XBlock/teams","hooks_url":"https://api.github.com/repos/edx/XBlock/hooks","issue_events_url":"https://api.github.com/repos/edx/XBlock/issues/events{/number}","events_url":"https://api.github.com/repos/edx/XBlock/events","assignees_url":"https://api.github.com/repos/edx/XBlock/assignees{/user}","branches_url":"https://api.github.com/repos/edx/XBlock/branches{/branch}","tags_url":"https://api.github.com/repos/edx/XBlock/tags","blobs_url":"https://api.github.com/repos/edx/XBlock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/XBlock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/XBlock/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/XBlock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/XBlock/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/XBlock/languages","stargazers_url":"https://api.github.com/repos/edx/XBlock/stargazers","contributors_url":"https://api.github.com/repos/edx/XBlock/contributors","subscribers_url":"https://api.github.com/repos/edx/XBlock/subscribers","subscription_url":"https://api.github.com/repos/edx/XBlock/subscription","commits_url":"https://api.github.com/repos/edx/XBlock/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/XBlock/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/XBlock/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/XBlock/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/XBlock/contents/{+path}","compare_url":"https://api.github.com/repos/edx/XBlock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/XBlock/merges","archive_url":"https://api.github.com/repos/edx/XBlock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/XBlock/downloads","issues_url":"https://api.github.com/repos/edx/XBlock/issues{/number}","pulls_url":"https://api.github.com/repos/edx/XBlock/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/XBlock/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/XBlock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/XBlock/labels{/name}","releases_url":"https://api.github.com/repos/edx/XBlock/releases{/id}","created_at":"2013-03-11T18:35:36Z","updated_at":"2015-10-21T08:54:20Z","pushed_at":"2015-10-21T18:21:48Z","git_url":"git://github.com/edx/XBlock.git","ssh_url":"git@github.com:edx/XBlock.git","clone_url":"https://github.com/edx/XBlock.git","svn_url":"https://github.com/edx/XBlock","homepage":null,"size":6988,"stargazers_count":389,"watchers_count":389,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":193,"mirror_url":null,"open_issues_count":29,"forks":193,"open_issues":29,"watchers":389,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/XBlock/pulls/323"},"html":{"href":"https://github.com/edx/XBlock/pull/323"},"issue":{"href":"https://api.github.com/repos/edx/XBlock/issues/323"},"comments":{"href":"https://api.github.com/repos/edx/XBlock/issues/323/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/XBlock/pulls/323/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/XBlock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/XBlock/pulls/323/commits"},"statuses":{"href":"https://api.github.com/repos/edx/XBlock/statuses/03b0f11be19eb489ec57ea70b94faf562f277037"}}}}