]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
parsemail: Don't catch exceptions when saving patches and comments
authorDamien Lespiau <damien.lespiau@intel.com>
Fri, 9 Oct 2015 10:22:54 +0000 (11:22 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Tue, 27 Oct 2015 02:04:01 +0000 (02:04 +0000)
We'd like to know when those operations fail in production so we can at
least inspect what happened through the email send to settings.ADMINS in
main().

Catching those exceptions early prevents that.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/bin/parsemail.py

index 84ab6859bc0a328ca66c0526da78b74bb59c7e20..c15564e9d3ed34d392c90cc7170562d5e7d9db4c 100755 (executable)
@@ -384,10 +384,7 @@ def parse_mail(mail):
         patch.state = get_state(mail.get('X-Patchwork-State', '').strip())
         patch.delegate = get_delegate(
                 mail.get('X-Patchwork-Delegate', '').strip())
-        try:
-            patch.save()
-        except Exception, ex:
-            print str(ex)
+        patch.save()
 
     if comment:
         if save_required:
@@ -397,10 +394,7 @@ def parse_mail(mail):
             comment.patch = patch
         comment.submitter = author
         comment.msgid = msgid
-        try:
-            comment.save()
-        except Exception, ex:
-            print str(ex)
+        comment.save()
 
     return 0