We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abca6eb commit d81a22dCopy full SHA for d81a22d
1 file changed
mssql_python/cursor.py
@@ -2621,7 +2621,13 @@ def _bulkcopy(
2621
# Fresh token acquisition for mssql-py-core connection
2622
from mssql_python.auth import AADAuth
2623
2624
- raw_token = AADAuth.get_raw_token(self.connection._auth_type)
+ try:
2625
+ raw_token = AADAuth.get_raw_token(self.connection._auth_type)
2626
+ except RuntimeError as e:
2627
+ raise RuntimeError(
2628
+ f"Bulk copy failed: unable to acquire Azure AD token "
2629
+ f"for auth_type '{self.connection._auth_type}': {e}"
2630
+ ) from e
2631
pycore_context["access_token"] = raw_token
2632
logger.debug(
2633
"Bulk copy: acquired fresh Azure AD token for auth_type=%s",
0 commit comments