Skip to content
Permalink
Browse files
fix #6842
  • Loading branch information
brushtyler committed Dec 10, 2012
1 parent 0e1b71c commit c203990cebf6ee8b65ee648b92f11cfd87fcc650
@@ -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):
@@ -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)
@@ -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
@@ -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
@@ -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

0 comments on commit c203990

Please sign in to comment.