{"action":"created","comment":{"url":"https://api.github.com/repos/mu-editor/mu/pulls/comments/97228513","pull_request_review_id":17833475,"id":97228513,"diff_hunk":"@@ -42,12 +42,21 @@ def setup_logging():\n     print('Logging to {}'.format(LOG_FILE))\n \n \n+def excepthook(*exc_args):\n+    \"\"\"\n+    Log exception and exit cleanly.\n+    \"\"\"\n+    logging.error('Unrecoverable error', exc_info=(exc_args))\n+    sys.exit(1)\n+\n+\n def run():\n     \"\"\"\n     Creates all the top-level assets for the application, sets things up and\n     then runs the application.\n     \"\"\"\n     setup_logging()\n+    sys.excepthook = excepthook","path":"mu/app.py","position":18,"original_position":18,"commit_id":"3f670a801844d8d34f9098688dde64dcddee8fcb","original_commit_id":"3f670a801844d8d34f9098688dde64dcddee8fcb","user":{"login":"carlosperate","id":4189262,"avatar_url":"https://avatars.githubusercontent.com/u/4189262?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosperate","html_url":"https://github.com/carlosperate","followers_url":"https://api.github.com/users/carlosperate/followers","following_url":"https://api.github.com/users/carlosperate/following{/other_user}","gists_url":"https://api.github.com/users/carlosperate/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosperate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosperate/subscriptions","organizations_url":"https://api.github.com/users/carlosperate/orgs","repos_url":"https://api.github.com/users/carlosperate/repos","events_url":"https://api.github.com/users/carlosperate/events{/privacy}","received_events_url":"https://api.github.com/users/carlosperate/received_events","type":"User","site_admin":false},"body":"Just a suggestion, we could move this line into `setup_logging()`.","created_at":"2017-01-22T17:36:53Z","updated_at":"2017-01-22T17:36:53Z","html_url":"https://github.com/mu-editor/mu/pull/234#discussion_r97228513","pull_request_url":"https://api.github.com/repos/mu-editor/mu/pulls/234","_links":{"self":{"href":"https://api.github.com/repos/mu-editor/mu/pulls/comments/97228513"},"html":{"href":"https://github.com/mu-editor/mu/pull/234#discussion_r97228513"},"pull_request":{"href":"https://api.github.com/repos/mu-editor/mu/pulls/234"}}},"pull_request":{"url":"https://api.github.com/repos/mu-editor/mu/pulls/234","id":102627943,"html_url":"https://github.com/mu-editor/mu/pull/234","diff_url":"https://github.com/mu-editor/mu/pull/234.diff","patch_url":"https://github.com/mu-editor/mu/pull/234.patch","issue_url":"https://api.github.com/repos/mu-editor/mu/issues/234","number":234,"state":"open","locked":false,"title":"Add sys.excepthook to log errors and quit cleanly","user":{"login":"inglesp","id":28734,"avatar_url":"https://avatars.githubusercontent.com/u/28734?v=3","gravatar_id":"","url":"https://api.github.com/users/inglesp","html_url":"https://github.com/inglesp","followers_url":"https://api.github.com/users/inglesp/followers","following_url":"https://api.github.com/users/inglesp/following{/other_user}","gists_url":"https://api.github.com/users/inglesp/gists{/gist_id}","starred_url":"https://api.github.com/users/inglesp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inglesp/subscriptions","organizations_url":"https://api.github.com/users/inglesp/orgs","repos_url":"https://api.github.com/users/inglesp/repos","events_url":"https://api.github.com/users/inglesp/events{/privacy}","received_events_url":"https://api.github.com/users/inglesp/received_events","type":"User","site_admin":false},"body":"This should make debugging things like #231 simpler.","created_at":"2017-01-22T17:15:53Z","updated_at":"2017-01-22T17:36:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1164fae5990b6e09c3aad65afd13b00f5d12e5a7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mu-editor/mu/pulls/234/commits","review_comments_url":"https://api.github.com/repos/mu-editor/mu/pulls/234/comments","review_comment_url":"https://api.github.com/repos/mu-editor/mu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mu-editor/mu/issues/234/comments","statuses_url":"https://api.github.com/repos/mu-editor/mu/statuses/3f670a801844d8d34f9098688dde64dcddee8fcb","head":{"label":"mu-editor:log-exceptions","ref":"log-exceptions","sha":"3f670a801844d8d34f9098688dde64dcddee8fcb","user":{"login":"mu-editor","id":17850097,"avatar_url":"https://avatars.githubusercontent.com/u/17850097?v=3","gravatar_id":"","url":"https://api.github.com/users/mu-editor","html_url":"https://github.com/mu-editor","followers_url":"https://api.github.com/users/mu-editor/followers","following_url":"https://api.github.com/users/mu-editor/following{/other_user}","gists_url":"https://api.github.com/users/mu-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/mu-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mu-editor/subscriptions","organizations_url":"https://api.github.com/users/mu-editor/orgs","repos_url":"https://api.github.com/users/mu-editor/repos","events_url":"https://api.github.com/users/mu-editor/events{/privacy}","received_events_url":"https://api.github.com/users/mu-editor/received_events","type":"Organization","site_admin":false},"repo":{"id":47607357,"name":"mu","full_name":"mu-editor/mu","owner":{"login":"mu-editor","id":17850097,"avatar_url":"https://avatars.githubusercontent.com/u/17850097?v=3","gravatar_id":"","url":"https://api.github.com/users/mu-editor","html_url":"https://github.com/mu-editor","followers_url":"https://api.github.com/users/mu-editor/followers","following_url":"https://api.github.com/users/mu-editor/following{/other_user}","gists_url":"https://api.github.com/users/mu-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/mu-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mu-editor/subscriptions","organizations_url":"https://api.github.com/users/mu-editor/orgs","repos_url":"https://api.github.com/users/mu-editor/repos","events_url":"https://api.github.com/users/mu-editor/events{/privacy}","received_events_url":"https://api.github.com/users/mu-editor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mu-editor/mu","description":"A \"micro\" editor for MicroPython and the BBC micro:bit. Written in Python and Qt5.","fork":false,"url":"https://api.github.com/repos/mu-editor/mu","forks_url":"https://api.github.com/repos/mu-editor/mu/forks","keys_url":"https://api.github.com/repos/mu-editor/mu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mu-editor/mu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mu-editor/mu/teams","hooks_url":"https://api.github.com/repos/mu-editor/mu/hooks","issue_events_url":"https://api.github.com/repos/mu-editor/mu/issues/events{/number}","events_url":"https://api.github.com/repos/mu-editor/mu/events","assignees_url":"https://api.github.com/repos/mu-editor/mu/assignees{/user}","branches_url":"https://api.github.com/repos/mu-editor/mu/branches{/branch}","tags_url":"https://api.github.com/repos/mu-editor/mu/tags","blobs_url":"https://api.github.com/repos/mu-editor/mu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mu-editor/mu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mu-editor/mu/git/refs{/sha}","trees_url":"https://api.github.com/repos/mu-editor/mu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mu-editor/mu/statuses/{sha}","languages_url":"https://api.github.com/repos/mu-editor/mu/languages","stargazers_url":"https://api.github.com/repos/mu-editor/mu/stargazers","contributors_url":"https://api.github.com/repos/mu-editor/mu/contributors","subscribers_url":"https://api.github.com/repos/mu-editor/mu/subscribers","subscription_url":"https://api.github.com/repos/mu-editor/mu/subscription","commits_url":"https://api.github.com/repos/mu-editor/mu/commits{/sha}","git_commits_url":"https://api.github.com/repos/mu-editor/mu/git/commits{/sha}","comments_url":"https://api.github.com/repos/mu-editor/mu/comments{/number}","issue_comment_url":"https://api.github.com/repos/mu-editor/mu/issues/comments{/number}","contents_url":"https://api.github.com/repos/mu-editor/mu/contents/{+path}","compare_url":"https://api.github.com/repos/mu-editor/mu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mu-editor/mu/merges","archive_url":"https://api.github.com/repos/mu-editor/mu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mu-editor/mu/downloads","issues_url":"https://api.github.com/repos/mu-editor/mu/issues{/number}","pulls_url":"https://api.github.com/repos/mu-editor/mu/pulls{/number}","milestones_url":"https://api.github.com/repos/mu-editor/mu/milestones{/number}","notifications_url":"https://api.github.com/repos/mu-editor/mu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mu-editor/mu/labels{/name}","releases_url":"https://api.github.com/repos/mu-editor/mu/releases{/id}","deployments_url":"https://api.github.com/repos/mu-editor/mu/deployments","created_at":"2015-12-08T07:56:02Z","updated_at":"2017-01-20T02:38:12Z","pushed_at":"2017-01-22T17:16:51Z","git_url":"git://github.com/mu-editor/mu.git","ssh_url":"git@github.com:mu-editor/mu.git","clone_url":"https://github.com/mu-editor/mu.git","svn_url":"https://github.com/mu-editor/mu","homepage":"http://codewith.mu","size":4536,"stargazers_count":95,"watchers_count":95,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":96,"forks":48,"open_issues":96,"watchers":95,"default_branch":"master"}},"base":{"label":"mu-editor:master","ref":"master","sha":"ab2cdebcb0a66455c654094322dad8b1d03e6615","user":{"login":"mu-editor","id":17850097,"avatar_url":"https://avatars.githubusercontent.com/u/17850097?v=3","gravatar_id":"","url":"https://api.github.com/users/mu-editor","html_url":"https://github.com/mu-editor","followers_url":"https://api.github.com/users/mu-editor/followers","following_url":"https://api.github.com/users/mu-editor/following{/other_user}","gists_url":"https://api.github.com/users/mu-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/mu-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mu-editor/subscriptions","organizations_url":"https://api.github.com/users/mu-editor/orgs","repos_url":"https://api.github.com/users/mu-editor/repos","events_url":"https://api.github.com/users/mu-editor/events{/privacy}","received_events_url":"https://api.github.com/users/mu-editor/received_events","type":"Organization","site_admin":false},"repo":{"id":47607357,"name":"mu","full_name":"mu-editor/mu","owner":{"login":"mu-editor","id":17850097,"avatar_url":"https://avatars.githubusercontent.com/u/17850097?v=3","gravatar_id":"","url":"https://api.github.com/users/mu-editor","html_url":"https://github.com/mu-editor","followers_url":"https://api.github.com/users/mu-editor/followers","following_url":"https://api.github.com/users/mu-editor/following{/other_user}","gists_url":"https://api.github.com/users/mu-editor/gists{/gist_id}","starred_url":"https://api.github.com/users/mu-editor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mu-editor/subscriptions","organizations_url":"https://api.github.com/users/mu-editor/orgs","repos_url":"https://api.github.com/users/mu-editor/repos","events_url":"https://api.github.com/users/mu-editor/events{/privacy}","received_events_url":"https://api.github.com/users/mu-editor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mu-editor/mu","description":"A \"micro\" editor for MicroPython and the BBC micro:bit. Written in Python and Qt5.","fork":false,"url":"https://api.github.com/repos/mu-editor/mu","forks_url":"https://api.github.com/repos/mu-editor/mu/forks","keys_url":"https://api.github.com/repos/mu-editor/mu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mu-editor/mu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mu-editor/mu/teams","hooks_url":"https://api.github.com/repos/mu-editor/mu/hooks","issue_events_url":"https://api.github.com/repos/mu-editor/mu/issues/events{/number}","events_url":"https://api.github.com/repos/mu-editor/mu/events","assignees_url":"https://api.github.com/repos/mu-editor/mu/assignees{/user}","branches_url":"https://api.github.com/repos/mu-editor/mu/branches{/branch}","tags_url":"https://api.github.com/repos/mu-editor/mu/tags","blobs_url":"https://api.github.com/repos/mu-editor/mu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mu-editor/mu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mu-editor/mu/git/refs{/sha}","trees_url":"https://api.github.com/repos/mu-editor/mu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mu-editor/mu/statuses/{sha}","languages_url":"https://api.github.com/repos/mu-editor/mu/languages","stargazers_url":"https://api.github.com/repos/mu-editor/mu/stargazers","contributors_url":"https://api.github.com/repos/mu-editor/mu/contributors","subscribers_url":"https://api.github.com/repos/mu-editor/mu/subscribers","subscription_url":"https://api.github.com/repos/mu-editor/mu/subscription","commits_url":"https://api.github.com/repos/mu-editor/mu/commits{/sha}","git_commits_url":"https://api.github.com/repos/mu-editor/mu/git/commits{/sha}","comments_url":"https://api.github.com/repos/mu-editor/mu/comments{/number}","issue_comment_url":"https://api.github.com/repos/mu-editor/mu/issues/comments{/number}","contents_url":"https://api.github.com/repos/mu-editor/mu/contents/{+path}","compare_url":"https://api.github.com/repos/mu-editor/mu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mu-editor/mu/merges","archive_url":"https://api.github.com/repos/mu-editor/mu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mu-editor/mu/downloads","issues_url":"https://api.github.com/repos/mu-editor/mu/issues{/number}","pulls_url":"https://api.github.com/repos/mu-editor/mu/pulls{/number}","milestones_url":"https://api.github.com/repos/mu-editor/mu/milestones{/number}","notifications_url":"https://api.github.com/repos/mu-editor/mu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mu-editor/mu/labels{/name}","releases_url":"https://api.github.com/repos/mu-editor/mu/releases{/id}","deployments_url":"https://api.github.com/repos/mu-editor/mu/deployments","created_at":"2015-12-08T07:56:02Z","updated_at":"2017-01-20T02:38:12Z","pushed_at":"2017-01-22T17:16:51Z","git_url":"git://github.com/mu-editor/mu.git","ssh_url":"git@github.com:mu-editor/mu.git","clone_url":"https://github.com/mu-editor/mu.git","svn_url":"https://github.com/mu-editor/mu","homepage":"http://codewith.mu","size":4536,"stargazers_count":95,"watchers_count":95,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":96,"forks":48,"open_issues":96,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mu-editor/mu/pulls/234"},"html":{"href":"https://github.com/mu-editor/mu/pull/234"},"issue":{"href":"https://api.github.com/repos/mu-editor/mu/issues/234"},"comments":{"href":"https://api.github.com/repos/mu-editor/mu/issues/234/comments"},"review_comments":{"href":"https://api.github.com/repos/mu-editor/mu/pulls/234/comments"},"review_comment":{"href":"https://api.github.com/repos/mu-editor/mu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mu-editor/mu/pulls/234/commits"},"statuses":{"href":"https://api.github.com/repos/mu-editor/mu/statuses/3f670a801844d8d34f9098688dde64dcddee8fcb"}}}}
{"actor":{"display_login":"carlosperate"}}