summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-05-06 00:49:11 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-05-06 00:49:11 +0200
commit9770a40e5fcbff4e08b5e4e11f9f9772667f59b6 (patch)
treec756732d9fcc87d1ee545d09e56c2bdca654ce2b
parentae7c506477e6b5c7d7c186193cd62b47e4501b52 (diff)
downloadpoezio-9770a40e5fcbff4e08b5e4e11f9f9772667f59b6.tar.gz
poezio-9770a40e5fcbff4e08b5e4e11f9f9772667f59b6.tar.bz2
poezio-9770a40e5fcbff4e08b5e4e11f9f9772667f59b6.tar.xz
poezio-9770a40e5fcbff4e08b5e4e11f9f9772667f59b6.zip
When reading logs, don’t consider a non-existing file as an error.
-rw-r--r--src/logger.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/logger.py b/src/logger.py
index 1a46f5e5..7efa8f61 100644
--- a/src/logger.py
+++ b/src/logger.py
@@ -117,10 +117,15 @@ class Logger(object):
try:
fd = open(os.path.join(log_dir, jid), 'rb')
- except:
+ except FileNotFoundError:
+ log.info('Non-existing log file (%s)',
+ os.path.join(log_dir, jid),
+ exc_info=True)
+ return
+ except OSError:
log.error('Unable to open the log file (%s)',
- os.path.join(log_dir, jid),
- exc_info=True)
+ os.path.join(log_dir, jid),
+ exc_info=True)
return
if not fd:
return