Handle RequestExceptions that are not 429s in _load_cryptomap

This commit is contained in:
A. Schueler 2021-05-22 11:51:43 +02:00
parent 8842e0d161
commit ab6bfbad12

View File

@ -58,6 +58,13 @@ class CryptoToFiatConverter:
"Too many requests for Coingecko API, backing off and trying again later.") "Too many requests for Coingecko API, backing off and trying again later.")
# Set backoff timestamp to 60 seconds in the future # Set backoff timestamp to 60 seconds in the future
self._backoff = datetime.datetime.now().timestamp() + 60 self._backoff = datetime.datetime.now().timestamp() + 60
return
# If the request is not a 429 error we want to raise the normal error
logger.error(
"Could not load FIAT Cryptocurrency map for the following problem: {}".format(
request_exception
)
)
except (Exception) as exception: except (Exception) as exception:
logger.error( logger.error(
f"Could not load FIAT Cryptocurrency map for the following problem: {exception}") f"Could not load FIAT Cryptocurrency map for the following problem: {exception}")