(sap) fix after bot review

This commit is contained in:
Vasilisa Parshikova 2026-03-11 15:23:21 +04:00 committed by Sameer Kankute
parent 9b26087bca
commit a7d23d638d
No known key found for this signature in database

View file

@ -339,7 +339,7 @@ def get_token_creator(
expiry_date = datetime.now(timezone.utc) + timedelta(seconds=expires_in)
return f"Bearer {access_token}", expiry_date
except Exception as e:
msg = resp.text if resp is not None else str(e)
msg = resp.text if resp is not None else getattr(e, "text", str(e))
raise RuntimeError(f"Token request failed: {msg}") from e
def _fetch_token() -> tuple[str, datetime]: