X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=market.py;h=9550b7706aa7194a6e09ab174ea0420206fd7832;hb=27bad39d3f2efcec0247b473627088149f462f79;hp=caa951330dac039fe4170d597394b50989eadb17;hpb=3a15ffc79ea84e5ec6200545bcbf11fc6c1c6564;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/market.py b/market.py index caa9513..9550b77 100644 --- a/market.py +++ b/market.py @@ -1,4 +1,4 @@ -from ccxt import ExchangeError, NotSupported, RequestTimeout, InvalidNonce +from ccxt import AuthenticationError, ExchangeError, NotSupported, RequestTimeout, InvalidNonce import ccxt_wrapper as ccxt import time import dbs @@ -88,6 +88,7 @@ class Market: def process(self, actions, before=False, after=False): try: + self.ccxt.check_required_credentials() for action in actions: if bool(before) is bool(after): self.processor.process(action, steps="all") @@ -95,6 +96,8 @@ class Market: self.processor.process(action, steps="before") elif after: self.processor.process(action, steps="after") + except AuthenticationError: + self.report.log_error("market_authentication", message="Impossible to authenticate to market") except Exception as e: import traceback self.report.log_error("market_process", exception=e, message=traceback.format_exc())