# HG changeset patch # User Dennis Fink # Date 2016-05-16 14:16:23 # Node ID 83bd05c310e2e5460942f81fed58b7d3ee267f93 # Parent 25bdbbb76c7fc13dd91197c2f5e4d5f7513eede0 # Parent dd827e1dedde1071de870d8acecee89f56f16aef Merged hotfix-oninoo-index-error 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',