From 22c7acde999679ebb98e1e2423c3ccba7478aa1d Mon Sep 17 00:00:00 2001 From: Fabien Benureau Date: Sat, 23 Jan 2016 02:31:20 +0100 Subject: [PATCH] Rewrite cache in case of any problem --- pubs/datacache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubs/datacache.py b/pubs/datacache.py index e7738d9..852359b 100644 --- a/pubs/datacache.py +++ b/pubs/datacache.py @@ -52,7 +52,7 @@ class DataCache(object): if self._metacache is None: try: self._metacache = self.databroker.pull_cache('metacache') - except IOError: + except Exception as e: # take no prisonners; if something is wrong, no cache. self._metacache = {} return self._metacache @@ -61,7 +61,7 @@ class DataCache(object): if self._bibcache is None: try: self._bibcache = self.databroker.pull_cache('bibcache') - except IOError: + except Exception as e: self._bibcache = {} return self._bibcache