error handling
This commit is contained in:
parent
574d8f82ef
commit
ad1adeff0a
|
|
@ -114,12 +114,19 @@ class earner:
|
||||||
return self.status_string
|
return self.status_string
|
||||||
|
|
||||||
def get_trading_balance(self):
|
def get_trading_balance(self):
|
||||||
return float(self.trading_balance)
|
try:
|
||||||
|
return float(self.trading_balance)
|
||||||
|
except Exception as e:
|
||||||
|
self.write_to_log(f"{e}")
|
||||||
|
return 0.0
|
||||||
|
|
||||||
def get_earning_balance(self):
|
def get_earning_balance(self):
|
||||||
return float(self.earning_balance)
|
try:
|
||||||
|
return float(self.earning_balance)
|
||||||
|
except Exception as e:
|
||||||
|
self.write_to_log(f"{e}")
|
||||||
|
return 0.0
|
||||||
|
|
||||||
|
|
||||||
def subscribe(self,amount,force_pause=False):
|
def subscribe(self,amount,force_pause=False):
|
||||||
print(f"{datetime.datetime.now().strftime('[%Y/%m/%d %H:%M:%S]')} | {str(self.connector).upper()} | {colors.green}Subscribing{colors.white} {amount} {self.currency}")
|
print(f"{datetime.datetime.now().strftime('[%Y/%m/%d %H:%M:%S]')} | {str(self.connector).upper()} | {colors.green}Subscribing{colors.white} {amount} {self.currency}")
|
||||||
self.write_to_log(f"{colors.green}Subscribing{colors.white} {amount} {self.currency}")
|
self.write_to_log(f"{colors.green}Subscribing{colors.white} {amount} {self.currency}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue