We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70ad65c commit 9de764bCopy full SHA for 9de764b
1 file changed
finegrain/src/finegrain/__init__.py
@@ -518,8 +518,14 @@ async def _q() -> httpx.Response:
518
if r.status_code == 401:
519
self.logger.debug("renewing token")
520
self.token = None
521
- await self.login()
522
- r = await _q()
+ login_ok = False
+ try:
523
+ await self.login()
524
+ login_ok = True
525
+ except httpx.HTTPStatusError as e:
526
+ self.logger.debug(f"login failed while renewing: {e}")
527
+ if login_ok:
528
+ r = await _q()
529
530
if raise_for_status:
531
check_status(r)
0 commit comments