Permalink
Browse files

Handle some email parsing errors.

  • Loading branch information...
1 parent 46e1837 commit b0b5dc1fa3f5fa744a642e3261f758ea97da2b90 Albin Stjerna committed Sep 19, 2012
Showing with 10 additions and 6 deletions.
  1. +2 −2 sluk-stats.py
  2. +8 −4 sluk.py
View
@@ -11,8 +11,8 @@
conf = ConfigParser.ConfigParser()
# CUSTOMIZE THESE VARIABLES TO YOUR LIKING
-rek = notmuch.Database().create_query("tag:feeds and tag:rek")
-feeds = notmuch.Database().create_query("tag:feeds")
+rek = notmuch.Database().create_query("folder:sluk and tag:rek")
+feeds = notmuch.Database().create_query("folder:sluk")
config_file = os.path.expanduser("~/.slukrc")
conf.readfp(open(config_file))
View
@@ -299,10 +299,14 @@ def update_feeds(update_feed_name="All"):
msg['X-Entry-URL'] = msg['Message-ID'] = link
# write to file
- entries.append({"path": path,
- "body": msg.as_string()})
-
- num_written += 1
+ try:
+ entries.append({"path": path,
+ "body": msg.as_string()})
+
+ num_written += 1
+ except email.errors.HeaderParseError as e:
+ print("E: parse error when generating email file: %s" % e)
+ continue
if num_written == 1:
print_optionally(" - 1 new entry")

0 comments on commit b0b5dc1

Please sign in to comment.