Skip to content

Commit 429f121

Browse files
authored
Merge pull request #434 from AzureAD/bubble-up-refresh-exception
Bubble up refresh exception when we cannot recover
2 parents d60e31e + 640d88a commit 429f121

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

msal/application.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,9 @@ def _acquire_token_silent_from_cache_and_possibly_refresh_it(
12071207
if (result and "error" not in result) or (not access_token_from_cache):
12081208
return result
12091209
except: # The exact HTTP exception is transportation-layer dependent
1210-
logger.exception("Refresh token failed") # Potential AAD outage?
1210+
# Typically network error. Potential AAD outage?
1211+
if not access_token_from_cache: # It means there is no fall back option
1212+
raise # We choose to bubble up the exception
12111213
return access_token_from_cache
12121214

12131215
def _acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family(

0 commit comments

Comments
 (0)