Skip to content

Commit

Permalink
Immediatly raise UsernameOrPasswordMissingError
Browse files Browse the repository at this point in the history
there is no need to retry several times
  • Loading branch information
metaodi committed Oct 13, 2024
1 parent 77a7220 commit 5b84809
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion osmapi/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ def _http(self, cmd, path, auth, send, return_value=True): # noqa
else:
logger.exception("ApiError Exception occured")
raise
except errors.UsernamePasswordMissingError:
raise
except Exception as e:
logger.exception("General exception occured")
if i == self.MAX_RETRY_LIMIT:
if isinstance(e, errors.OsmApiError):
raise
raise errors.MaximumRetryLimitReachedError(
f"Give up after {i} retries"
)
) from e
if i != 1:
self._sleep()
self._session = self._get_http_session()
Expand Down

0 comments on commit 5b84809

Please sign in to comment.