Skip to content

Commit

Permalink
Catch google NotFound exception as a DbtDatabaseError (#1360) (#1361
Browse files Browse the repository at this point in the history
)

* catch google NotFound exception as a DbtDatabaseError

(cherry picked from commit 8833c54)

Co-authored-by: Mike Alfare <[email protected]>
  • Loading branch information
github-actions[bot] and mikealfare authored Oct 2, 2024
1 parent 97904ef commit 3a590da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20241001-193207.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: Catch additional database error exception, NotFound, as a DbtDatabaseError instead
of defaulting to a DbtRuntimeError
time: 2024-10-01T19:32:07.304353-04:00
custom:
Author: mikealfare
Issue: "1360"
4 changes: 4 additions & 0 deletions dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ def exception_handler(self, sql):
message = "Access denied while running query"
self.handle_error(e, message)

except google.cloud.exceptions.NotFound as e:
message = "Not found while running query"
self.handle_error(e, message)

except google.auth.exceptions.RefreshError as e:
message = (
"Unable to generate access token, if you're using "
Expand Down

0 comments on commit 3a590da

Please sign in to comment.