Skip to content

Commit

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

* changelog

(cherry picked from commit 8833c54)
  • Loading branch information
mikealfare authored and github-actions[bot] committed Oct 2, 2024
1 parent 97904ef commit 29087eb
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 29087eb

Please sign in to comment.