From c1776bbf9d00bb4c6bfe0c5bfc03c460e4eae411 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 20 Jun 2017 12:03:31 +0200 Subject: [PATCH] Add error message when query failed to prepare --- qutebrowser/misc/sql.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py index 1f93f8c06..3bd02352c 100644 --- a/qutebrowser/misc/sql.py +++ b/qutebrowser/misc/sql.py @@ -70,7 +70,8 @@ class Query(QSqlQuery): super().__init__(QSqlDatabase.database()) log.sql.debug('Preparing SQL query: "{}"'.format(querystr)) if not self.prepare(querystr): - raise SqlException('Failed to prepare query "{}"'.format(querystr)) + raise SqlException('Failed to prepare query "{}": "{}"'.format( + querystr, self.lastError().text())) self.setForwardOnly(forward_only) def __iter__(self):