Skip to content

Commit 679f0ef

Browse files
emanCopilot
andauthored
Update src/nwp500/api_client.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4ed6ece commit 679f0ef

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/nwp500/api_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,13 @@ async def _make_request(
169169
)
170170
try:
171171
# Try to refresh the token
172-
if self._auth_client.current_tokens:
172+
if self._auth_client.current_tokens and getattr(self._auth_client.current_tokens, "refresh_token", None):
173173
await self._auth_client.refresh_token(
174174
self._auth_client.current_tokens.refresh_token
175175
)
176+
else:
177+
_logger.error("No refresh_token available for token refresh.")
178+
raise AuthenticationError("No refresh_token available for token refresh.")
176179
# Retry the request once with new token
177180
return await self._make_request(
178181
method,

0 commit comments

Comments
 (0)