Skip to content

Commit

Permalink
Handle query error
Browse files Browse the repository at this point in the history
  • Loading branch information
strk committed Jan 10, 2020
1 parent bf4ed9a commit 1ee8034
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -95,7 +95,10 @@ def _execute(self, sql=None):
if (self.sql == None):
return
self._debug("execute called with sql " + self.sql)
self.result = self._toStrResultSet(self.connection.executeSql(self.sql))
try:
self.result = self._toStrResultSet(self.connection.executeSql(self.sql))
except QgsProviderConnectionException as e:
raise DbError(e, self.sql)
self._debug("execute returned " + str(len(self.result)) + " rows")
self.cursor = 0

Expand Down

0 comments on commit 1ee8034

Please sign in to comment.