diff mbox

parsemail: Don't catch exceptions when saving patches and comments

Message ID 1444386174-25182-1-git-send-email-damien.lespiau@intel.com
State Accepted
Headers show

Commit Message

Damien Lespiau Oct. 9, 2015, 10:22 a.m. UTC
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>
---
 patchwork/bin/parsemail.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Stephen Finucane Oct. 9, 2015, 11:21 p.m. UTC | #1
> 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>
Stephen Finucane Oct. 27, 2015, 2:04 a.m. UTC | #2
> > 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>


Merged.

Stephen
diff mbox

Patch

diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
index 84ab685..c15564e 100755
--- a/patchwork/bin/parsemail.py
+++ b/patchwork/bin/parsemail.py
@@ -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