{"action":"created","comment":{"url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments/143452994","pull_request_review_id":67965641,"id":143452994,"diff_hunk":"@@ -29,23 +29,73 @@\n \n class SqlError(Exception):\n \n-    \"\"\"Raised on an error interacting with the SQL database.\"\"\"\n+    \"\"\"Raised on an error interacting with the SQL database.\n \n-    pass\n+    Attributes:\n+        environmental: Whether the error is likely caused by the environment and\n+                       not a qutebrowser bug.\n+    \"\"\"\n+\n+    def __init__(self, msg, environmental=False):\n+        super().__init__(msg)\n+        self.environmental = environmental\n+\n+\n+class SqliteError(SqlError):\n+\n+    \"\"\"A SQL error with a QSqlError available.\n+\n+    Attributes:\n+        error: The QSqlError object.\n+    \"\"\"\n+\n+    def __init__(self, msg, error):\n+        super().__init__(msg)\n+        self.error = error\n+\n+        log.sql.debug(\"SQL error:\")\n+        log.sql.debug(\"type: {}\".format(\n+            debug.qenum_key(QSqlError, error.type())))\n+        log.sql.debug(\"database text: {}\".format(error.databaseText()))\n+        log.sql.debug(\"driver text: {}\".format(error.driverText()))\n+        log.sql.debug(\"error code: {}\".format(error.nativeErrorCode()))\n+\n+        # https://sqlite.org/rescode.html\n+        environmental_errors = [\n+            # SQLITE_LOCKED,\n+            # https://github.com/qutebrowser/qutebrowser/issues/2930\n+            '9',\n+            # SQLITE_FULL,\n+            # https://github.com/qutebrowser/qutebrowser/issues/3004\n+            '13',","path":"qutebrowser/misc/sql.py","position":44,"original_position":44,"commit_id":"5cd4be90157bc8327c5758838caa13c71af7fcf2","original_commit_id":"5cd4be90157bc8327c5758838caa13c71af7fcf2","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars0.githubusercontent.com/u/625793?v=4","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"body":"Looking at https://sqlite.org/rescode.html there are probably more which would fit here, but I'd rather be conservative here and add things when they actually turn out to be a problem in practice.","created_at":"2017-10-09T12:26:23Z","updated_at":"2017-10-09T12:26:23Z","html_url":"https://github.com/qutebrowser/qutebrowser/pull/3073#discussion_r143452994","pull_request_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments/143452994"},"html":{"href":"https://github.com/qutebrowser/qutebrowser/pull/3073#discussion_r143452994"},"pull_request":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073"}}},"pull_request":{"url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073","id":145439600,"html_url":"https://github.com/qutebrowser/qutebrowser/pull/3073","diff_url":"https://github.com/qutebrowser/qutebrowser/pull/3073.diff","patch_url":"https://github.com/qutebrowser/qutebrowser/pull/3073.patch","issue_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/3073","number":3073,"state":"open","locked":false,"title":"Handle some sqlite errors gracefully","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars0.githubusercontent.com/u/625793?v=4","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"body":"We mark some SQL errors as \"environmental\", and then show those as error\r\nmessages instead of raising an exception.\r\n\r\nFixes #3004\r\nWorkaround for #2930\r\n\r\n@lahwaacz @rcorre Can you help with reviewing this?\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/qutebrowser/qutebrowser/3073)\n<!-- Reviewable:end -->\n","created_at":"2017-10-09T12:25:16Z","updated_at":"2017-10-09T12:26:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12f64efafd03f9a26d9ab2f342ee460abe1b1228","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rcorre","id":2496231,"avatar_url":"https://avatars3.githubusercontent.com/u/2496231?v=4","gravatar_id":"","url":"https://api.github.com/users/rcorre","html_url":"https://github.com/rcorre","followers_url":"https://api.github.com/users/rcorre/followers","following_url":"https://api.github.com/users/rcorre/following{/other_user}","gists_url":"https://api.github.com/users/rcorre/gists{/gist_id}","starred_url":"https://api.github.com/users/rcorre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcorre/subscriptions","organizations_url":"https://api.github.com/users/rcorre/orgs","repos_url":"https://api.github.com/users/rcorre/repos","events_url":"https://api.github.com/users/rcorre/events{/privacy}","received_events_url":"https://api.github.com/users/rcorre/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/qutebrowser/qutebrowser/milestones/7","html_url":"https://github.com/qutebrowser/qutebrowser/milestone/7","labels_url":"https://api.github.com/repos/qutebrowser/qutebrowser/milestones/7/labels","id":1166227,"number":7,"title":"v1.0.0","description":"Or maybe on November 14th seeing that Firefox 57 will be released then... ","creator":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars0.githubusercontent.com/u/625793?v=4","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":51,"state":"open","created_at":"2015-06-16T06:45:24Z","updated_at":"2017-10-09T12:25:16Z","due_on":"2017-12-14T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073/commits","review_comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073/comments","review_comment_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/3073/comments","statuses_url":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/5cd4be90157bc8327c5758838caa13c71af7fcf2","head":{"label":"qutebrowser:sql-errors","ref":"sql-errors","sha":"5cd4be90157bc8327c5758838caa13c71af7fcf2","user":{"login":"qutebrowser","id":21955151,"avatar_url":"https://avatars1.githubusercontent.com/u/21955151?v=4","gravatar_id":"","url":"https://api.github.com/users/qutebrowser","html_url":"https://github.com/qutebrowser","followers_url":"https://api.github.com/users/qutebrowser/followers","following_url":"https://api.github.com/users/qutebrowser/following{/other_user}","gists_url":"https://api.github.com/users/qutebrowser/gists{/gist_id}","starred_url":"https://api.github.com/users/qutebrowser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutebrowser/subscriptions","organizations_url":"https://api.github.com/users/qutebrowser/orgs","repos_url":"https://api.github.com/users/qutebrowser/repos","events_url":"https://api.github.com/users/qutebrowser/events{/privacy}","received_events_url":"https://api.github.com/users/qutebrowser/received_events","type":"Organization","site_admin":false},"repo":{"id":21244505,"name":"qutebrowser","full_name":"qutebrowser/qutebrowser","owner":{"login":"qutebrowser","id":21955151,"avatar_url":"https://avatars1.githubusercontent.com/u/21955151?v=4","gravatar_id":"","url":"https://api.github.com/users/qutebrowser","html_url":"https://github.com/qutebrowser","followers_url":"https://api.github.com/users/qutebrowser/followers","following_url":"https://api.github.com/users/qutebrowser/following{/other_user}","gists_url":"https://api.github.com/users/qutebrowser/gists{/gist_id}","starred_url":"https://api.github.com/users/qutebrowser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutebrowser/subscriptions","organizations_url":"https://api.github.com/users/qutebrowser/orgs","repos_url":"https://api.github.com/users/qutebrowser/repos","events_url":"https://api.github.com/users/qutebrowser/events{/privacy}","received_events_url":"https://api.github.com/users/qutebrowser/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qutebrowser/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":false,"url":"https://api.github.com/repos/qutebrowser/qutebrowser","forks_url":"https://api.github.com/repos/qutebrowser/qutebrowser/forks","keys_url":"https://api.github.com/repos/qutebrowser/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qutebrowser/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qutebrowser/qutebrowser/teams","hooks_url":"https://api.github.com/repos/qutebrowser/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/qutebrowser/qutebrowser/events","assignees_url":"https://api.github.com/repos/qutebrowser/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/qutebrowser/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/qutebrowser/qutebrowser/tags","blobs_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/qutebrowser/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/qutebrowser/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/qutebrowser/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/qutebrowser/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/qutebrowser/qutebrowser/subscription","commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/qutebrowser/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/qutebrowser/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qutebrowser/qutebrowser/merges","archive_url":"https://api.github.com/repos/qutebrowser/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qutebrowser/qutebrowser/downloads","issues_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/qutebrowser/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/qutebrowser/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qutebrowser/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/qutebrowser/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/deployments","created_at":"2014-06-26T14:59:34Z","updated_at":"2017-10-08T17:51:01Z","pushed_at":"2017-10-09T12:25:21Z","git_url":"git://github.com/qutebrowser/qutebrowser.git","ssh_url":"git@github.com:qutebrowser/qutebrowser.git","clone_url":"https://github.com/qutebrowser/qutebrowser.git","svn_url":"https://github.com/qutebrowser/qutebrowser","homepage":"https://www.qutebrowser.org/","size":26261,"stargazers_count":2372,"watchers_count":2372,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":345,"mirror_url":null,"open_issues_count":487,"forks":345,"open_issues":487,"watchers":2372,"default_branch":"master"}},"base":{"label":"qutebrowser:master","ref":"master","sha":"6498273b3197a144f6a957e381c81872194385da","user":{"login":"qutebrowser","id":21955151,"avatar_url":"https://avatars1.githubusercontent.com/u/21955151?v=4","gravatar_id":"","url":"https://api.github.com/users/qutebrowser","html_url":"https://github.com/qutebrowser","followers_url":"https://api.github.com/users/qutebrowser/followers","following_url":"https://api.github.com/users/qutebrowser/following{/other_user}","gists_url":"https://api.github.com/users/qutebrowser/gists{/gist_id}","starred_url":"https://api.github.com/users/qutebrowser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutebrowser/subscriptions","organizations_url":"https://api.github.com/users/qutebrowser/orgs","repos_url":"https://api.github.com/users/qutebrowser/repos","events_url":"https://api.github.com/users/qutebrowser/events{/privacy}","received_events_url":"https://api.github.com/users/qutebrowser/received_events","type":"Organization","site_admin":false},"repo":{"id":21244505,"name":"qutebrowser","full_name":"qutebrowser/qutebrowser","owner":{"login":"qutebrowser","id":21955151,"avatar_url":"https://avatars1.githubusercontent.com/u/21955151?v=4","gravatar_id":"","url":"https://api.github.com/users/qutebrowser","html_url":"https://github.com/qutebrowser","followers_url":"https://api.github.com/users/qutebrowser/followers","following_url":"https://api.github.com/users/qutebrowser/following{/other_user}","gists_url":"https://api.github.com/users/qutebrowser/gists{/gist_id}","starred_url":"https://api.github.com/users/qutebrowser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutebrowser/subscriptions","organizations_url":"https://api.github.com/users/qutebrowser/orgs","repos_url":"https://api.github.com/users/qutebrowser/repos","events_url":"https://api.github.com/users/qutebrowser/events{/privacy}","received_events_url":"https://api.github.com/users/qutebrowser/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qutebrowser/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":false,"url":"https://api.github.com/repos/qutebrowser/qutebrowser","forks_url":"https://api.github.com/repos/qutebrowser/qutebrowser/forks","keys_url":"https://api.github.com/repos/qutebrowser/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qutebrowser/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qutebrowser/qutebrowser/teams","hooks_url":"https://api.github.com/repos/qutebrowser/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/qutebrowser/qutebrowser/events","assignees_url":"https://api.github.com/repos/qutebrowser/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/qutebrowser/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/qutebrowser/qutebrowser/tags","blobs_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/qutebrowser/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/qutebrowser/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/qutebrowser/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/qutebrowser/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/qutebrowser/qutebrowser/subscription","commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/qutebrowser/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/qutebrowser/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/qutebrowser/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qutebrowser/qutebrowser/merges","archive_url":"https://api.github.com/repos/qutebrowser/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qutebrowser/qutebrowser/downloads","issues_url":"https://api.github.com/repos/qutebrowser/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/qutebrowser/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/qutebrowser/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qutebrowser/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/qutebrowser/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/qutebrowser/qutebrowser/deployments","created_at":"2014-06-26T14:59:34Z","updated_at":"2017-10-08T17:51:01Z","pushed_at":"2017-10-09T12:25:21Z","git_url":"git://github.com/qutebrowser/qutebrowser.git","ssh_url":"git@github.com:qutebrowser/qutebrowser.git","clone_url":"https://github.com/qutebrowser/qutebrowser.git","svn_url":"https://github.com/qutebrowser/qutebrowser","homepage":"https://www.qutebrowser.org/","size":26261,"stargazers_count":2372,"watchers_count":2372,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":345,"mirror_url":null,"open_issues_count":487,"forks":345,"open_issues":487,"watchers":2372,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073"},"html":{"href":"https://github.com/qutebrowser/qutebrowser/pull/3073"},"issue":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/3073"},"comments":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/issues/3073/comments"},"review_comments":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073/comments"},"review_comment":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/pulls/3073/commits"},"statuses":{"href":"https://api.github.com/repos/qutebrowser/qutebrowser/statuses/5cd4be90157bc8327c5758838caa13c71af7fcf2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"The-Compiler"}}