Handle exceptions when updating currencies

master
Nikola Forró 5 years ago
parent d9bbbe6885
commit 076e763224

@ -215,7 +215,12 @@ class Commands(object):
def convert(self, expression, unit=None): def convert(self, expression, unit=None):
c = Converter() c = Converter()
c.update_currencies(*self.rates.query()) try:
base, rates = self.rates.query()
except ExchangeRatesError:
pass
else:
c.update_currencies(base, rates)
try: try:
return c.convert(expression, unit) return c.convert(expression, unit)
except ConverterError as e: except ConverterError as e:

Loading…
Cancel
Save