Skip to content

Commit

Permalink
retry relogin if parse json false (#113)
Browse files Browse the repository at this point in the history
* retry relogin if parse json false
No-Issue

* Update galaxykit/client.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update galaxykit/client.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
chr-stian and github-actions[bot] authored May 31, 2024
1 parent 370f2ce commit bfd637f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion galaxykit/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,13 @@ def _http(self, method, path, *args, **kwargs):
raise GalaxyClientError(resp, resp.status_code)
return json_data
else:
if resp.status_code >= 400:
if resp.status_code == 401 and "gateway_sessionid" in self.headers.get(
"Cookie"
):
return self._retry_if_expired_gw_token(
method, url, headers, *args, **kwargs
)
elif resp.status_code >= 400:
logging.debug(resp.text)
raise GalaxyClientError(resp, resp.status_code)
return resp
Expand Down

0 comments on commit bfd637f

Please sign in to comment.