From f92c0775b31965f2579eb4f373d0d60b649ae635 Mon Sep 17 00:00:00 2001 From: Virginia Czosek Date: Thu, 19 Apr 2018 14:23:56 -0700 Subject: [PATCH 1/3] Handle temporary absence of fees data by ignoring errors in loading fees file. --- ratechecker/dataset.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ratechecker/dataset.py b/ratechecker/dataset.py index 673d138..ff7ad01 100644 --- a/ratechecker/dataset.py +++ b/ratechecker/dataset.py @@ -40,7 +40,14 @@ def filename_prefix(self): def load(self): for key, loader_cls in self.loaders.items(): - f = self.datafile(key) + try: + f = self.datafile(key) + except KeyError: + if key =='fee': + continue + raise + except Exception: + raise loader = loader_cls(f, data_timestamp=self.timestamp) loader.load() From d63948fa8882c394ca7b011c7c3e8253ea7a86a2 Mon Sep 17 00:00:00 2001 From: Virginia Czosek Date: Thu, 19 Apr 2018 14:30:27 -0700 Subject: [PATCH 2/3] Fix spacing --- ratechecker/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ratechecker/dataset.py b/ratechecker/dataset.py index ff7ad01..eae9e29 100644 --- a/ratechecker/dataset.py +++ b/ratechecker/dataset.py @@ -43,7 +43,7 @@ def load(self): try: f = self.datafile(key) except KeyError: - if key =='fee': + if key == 'fee': continue raise except Exception: From 0fe0f6eb25da82ac24443d2b3990a1b3ea6ce922 Mon Sep 17 00:00:00 2001 From: Virginia Czosek Date: Thu, 19 Apr 2018 23:45:30 -0700 Subject: [PATCH 3/3] Remove unnecessary exception handler and add comment. --- ratechecker/dataset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ratechecker/dataset.py b/ratechecker/dataset.py index eae9e29..f7d3751 100644 --- a/ratechecker/dataset.py +++ b/ratechecker/dataset.py @@ -43,11 +43,12 @@ def load(self): try: f = self.datafile(key) except KeyError: + # The fees data is expected to be temporarily unavailable, + # so if the fees file is not found, we skip it and + # continue loading the other data types. if key == 'fee': continue raise - except Exception: - raise loader = loader_cls(f, data_timestamp=self.timestamp) loader.load()