Skip to content

Commit

Permalink
fix #6842
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler committed Dec 10, 2012
1 parent 0e1b71c commit c203990
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/connector.py
Expand Up @@ -25,7 +25,7 @@

from qgis.core import QgsDataSourceURI

from .plugin import DbError, ConnectionError
from .plugin import BaseError, DbError, ConnectionError

class DBConnector:
def __init__(self, uri):
Expand Down Expand Up @@ -75,10 +75,10 @@ def _execute(self, cursor, sql):
try:
cursor.execute(unicode(sql))

except self.connection_error_types(), e:
except self.connection_error_types() as e:
raise ConnectionError(e)

except self.execution_error_types(), e:
except self.execution_error_types() as e:
# do the rollback to avoid a "current transaction aborted, commands ignored" errors
self._rollback()
raise DbError(e, sql)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -866,7 +866,7 @@ def deleteSpatialIndex(self, table, geom_column='geom'):


def execution_error_types(self):
return psycopg2.Error, psycopg2.ProgrammingError
return psycopg2.Error, psycopg2.ProgrammingError, psycopg2.Warning

def connection_error_types(self):
return psycopg2.InterfaceError, psycopg2.OperationalError
Expand Down
Expand Up @@ -554,7 +554,7 @@ def hasSpatialIndex(self, table, geom_column='geometry'):


def execution_error_types(self):
return sqlite.Error, sqlite.ProgrammingError
return sqlite.Error, sqlite.ProgrammingError, sqlite.Warning

def connection_error_types(self):
return sqlite.InterfaceError, sqlite.OperationalError
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/dlg_sql_window.py
Expand Up @@ -196,7 +196,7 @@ def fillColumnCombos(self):
c = connector._execute(None, sql)
cols = connector._get_cursor_columns(c)

except (BaseError, Warning) as e:
except BaseError as e:
QApplication.restoreOverrideCursor()
DlgDbError.showError(e, self)
return
Expand Down

0 comments on commit c203990

Please sign in to comment.