diff --git a/ennstatus/api/model.py b/ennstatus/api/model.py --- a/ennstatus/api/model.py +++ b/ennstatus/api/model.py @@ -235,7 +235,10 @@ class Server: except requests.HTTPError as e: raise e else: - data = data.json()['relays'][0] + try: + data = data.json()['relays'][0] + except IndexError as e: + raise RuntimeError from e self.mean_consensus_weight = calculate_weight(data['consensus_weight']) self.mean_exit_probability = calculate_weight(data['exit_probability']) diff --git a/ennstatus/api/views.py b/ennstatus/api/views.py --- a/ennstatus/api/views.py +++ b/ennstatus/api/views.py @@ -123,6 +123,9 @@ def update(): except requests.HTTPError as e: current_app.logger.error(str(e), exc_info=True) pass + except RuntimeError as e: + current_app.logger.error(str(e), exc_info=True) + pass try: server.save() diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def _get_requirements(): setup(name='Ennstatus', - version='5.4.3', + version='5.4.4', description=('Ennstatus provides the user with vital information about ' 'the status of the organizations Tor servers.'), author='Frënn vun der Ënn',