Skip to content

Commit

Permalink
Fix innoverio.vscode-dbt-power-user Exasol errors (#78)
Browse files Browse the repository at this point in the history
The innoverio.vscode-dbt-power-user VScode extension expects all errors
coming from DBT adapters to be raised as DBT errors. The dbt-exasol
adapter was raising Exasol DB errors as pyexasol's QueryError error type
and so this caused problems in the vscode extension.

This commit changes the error to the standard DBT DB error type.

Co-authored-by: Peter Kioko <kioko@grantstreet.com>
  • Loading branch information
peterkioko and Peter Kioko authored Jun 12, 2023
1 parent 1e4f63f commit 7ba0bd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dbt/adapters/exasol/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ def execute(self, query, bindings: Optional[Any] = None):
for sql in sqls:
self.stmt = self.connection.execute(sql)
else:
self.stmt = self.connection.execute(query)
try:
self.stmt = self.connection.execute(query)
except pyexasol.ExaQueryError as e:
raise dbt.exceptions.DbtDatabaseError("Exasol Query Error: " + e.message)
return self

def fetchone(self):
Expand Down

0 comments on commit 7ba0bd6

Please # to comment.