From 32a23358211e980f764804ec1cd6a6cee685b8f6 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 26 Nov 2018 11:55:22 +0100 Subject: [PATCH] Improve error output. --- .gitignore | 2 ++ mail_today.py | 1 - scan_moslogs.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2a22da1..b6f18b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.log *.pyc /.last_file +/export.csv /mosobjects.db3 diff --git a/mail_today.py b/mail_today.py index 6ef826f..7f5d96e 100755 --- a/mail_today.py +++ b/mail_today.py @@ -37,7 +37,6 @@ msg.attach(att) #print(repr(clips)) print(msg.as_string()) - p = Popen(["/usr/sbin/sendmail", "-oi", "markus.birth@weltn24.de", "sebastian.erb@weltn24.de"], stdin=PIPE) p.communicate(msg.as_bytes()) diff --git a/scan_moslogs.py b/scan_moslogs.py index 2b68c76..8ffbf9f 100755 --- a/scan_moslogs.py +++ b/scan_moslogs.py @@ -68,8 +68,8 @@ for file in files_to_parse: except ET.ParseError as e: print("ERROR parsing {}: {}".format(file, e), file=sys.stderr) break - except: - print("ERROR processing {}!".format(file), file=sys.stderr) + except Exception as e: + print("ERROR processing {} - {}!".format(file, e), file=sys.stderr) break db.finish()