Skip to content

Commit d921106

Browse files
authored
chore: include api error info in raised errors (#699)
* chore: include api error info in raised errors * format strings
1 parent 4051266 commit d921106

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas_gbq/gbq.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -483,13 +483,15 @@ def run_query(self, query, max_results=None, progress_bar_type=None, **kwargs):
483483
project=self.project_id,
484484
)
485485
logger.debug("Query running...")
486-
except (RefreshError, ValueError):
486+
except (RefreshError, ValueError) as ex:
487487
if self.private_key:
488-
raise AccessDenied("The service account credentials are not valid")
488+
raise AccessDenied(
489+
f"The service account credentials are not valid: {ex}"
490+
)
489491
else:
490492
raise AccessDenied(
491493
"The credentials have been revoked or expired, "
492-
"please re-run the application to re-authorize"
494+
f"please re-run the application to re-authorize: {ex}"
493495
)
494496
except self.http_error as ex:
495497
self.process_http_error(ex)

0 commit comments

Comments
 (0)