From 076e76322440e09b22dfe99ee4d2dfd2840e27d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Thu, 22 Aug 2019 16:43:47 +0200 Subject: [PATCH] Handle exceptions when updating currencies --- commands.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands.py b/commands.py index 4a2907b..9562351 100644 --- a/commands.py +++ b/commands.py @@ -215,7 +215,12 @@ class Commands(object): def convert(self, expression, unit=None): c = Converter() - c.update_currencies(*self.rates.query()) + try: + base, rates = self.rates.query() + except ExchangeRatesError: + pass + else: + c.update_currencies(base, rates) try: return c.convert(expression, unit) except ConverterError as e: