Skip to content

Commit c203990

Browse files
committedDec 10, 2012
fix #6842
1 parent 0e1b71c commit c203990

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎python/plugins/db_manager/db_plugins/connector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from qgis.core import QgsDataSourceURI
2727

28-
from .plugin import DbError, ConnectionError
28+
from .plugin import BaseError, DbError, ConnectionError
2929

3030
class DBConnector:
3131
def __init__(self, uri):
@@ -75,10 +75,10 @@ def _execute(self, cursor, sql):
7575
try:
7676
cursor.execute(unicode(sql))
7777

78-
except self.connection_error_types(), e:
78+
except self.connection_error_types() as e:
7979
raise ConnectionError(e)
8080

81-
except self.execution_error_types(), e:
81+
except self.execution_error_types() as e:
8282
# do the rollback to avoid a "current transaction aborted, commands ignored" errors
8383
self._rollback()
8484
raise DbError(e, sql)

‎python/plugins/db_manager/db_plugins/postgis/connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ def deleteSpatialIndex(self, table, geom_column='geom'):
866866

867867

868868
def execution_error_types(self):
869-
return psycopg2.Error, psycopg2.ProgrammingError
869+
return psycopg2.Error, psycopg2.ProgrammingError, psycopg2.Warning
870870

871871
def connection_error_types(self):
872872
return psycopg2.InterfaceError, psycopg2.OperationalError

‎python/plugins/db_manager/db_plugins/spatialite/connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def hasSpatialIndex(self, table, geom_column='geometry'):
554554

555555

556556
def execution_error_types(self):
557-
return sqlite.Error, sqlite.ProgrammingError
557+
return sqlite.Error, sqlite.ProgrammingError, sqlite.Warning
558558

559559
def connection_error_types(self):
560560
return sqlite.InterfaceError, sqlite.OperationalError

‎python/plugins/db_manager/dlg_sql_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def fillColumnCombos(self):
196196
c = connector._execute(None, sql)
197197
cols = connector._get_cursor_columns(c)
198198

199-
except (BaseError, Warning) as e:
199+
except BaseError as e:
200200
QApplication.restoreOverrideCursor()
201201
DlgDbError.showError(e, self)
202202
return

0 commit comments

Comments
 (0)
Please sign in to comment.