Skip to content

Commit 8c31789

Browse files
committed
Enhance retry logic for debug
1 parent 070c1a4 commit 8c31789

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tosfs/certification.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ def get_credentials(self) -> Credentials:
230230
return self.credentials
231231
except JSONDecodeError as e:
232232
logger.error(
233-
f"Failed to parse the response from the url: {self.credential_url}, "
234-
f"error: {e}, detail: {e.doc}"
233+
f"Failed to parse the response from the url: "
234+
f"{self.credential_url}, error: {e}, detail: {e.doc}"
235235
)
236236
if self.expires is not None and (
237237
datetime.now().timestamp() < self.expires.timestamp()
@@ -308,7 +308,7 @@ def get_credentials(self) -> Credentials:
308308
f"error: {e}, detail: {e.doc}"
309309
)
310310
if self.expires is not None and (
311-
datetime.now().timestamp() < self.expires.timestamp()
311+
datetime.now().timestamp() < self.expires.timestamp()
312312
):
313313
return self.credentials
314314
raise TosfsCertificationError(
@@ -319,7 +319,7 @@ def get_credentials(self) -> Credentials:
319319
datetime.now().timestamp() < self.expires.timestamp()
320320
):
321321
return self.credentials
322-
raise TosfsCertificationError("Get token failed") from e
322+
raise TosfsCertificationError(f"Get token failed: {e}") from e
323323

324324
def _try_get_credentials(self) -> Optional[Credentials]:
325325
if self.expires is None or self.credentials is None:

0 commit comments

Comments
 (0)