[tor-commits] [bridgedb/master] Add try/except around parent class	errback call in SMTPAutoresponder.
    isis at torproject.org 
    isis at torproject.org
       
    Fri Jun  6 23:39:15 UTC 2014
    
    
  
commit 9861fdf7ebcc5fdfe613a9600e0273615e1a4255
Author: Isis Lovecruft <isis at torproject.org>
Date:   Wed Jun 4 17:15:53 2014 +0000
    Add try/except around parent class errback call in SMTPAutoresponder.
---
 lib/bridgedb/email/autoresponder.py |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/bridgedb/email/autoresponder.py b/lib/bridgedb/email/autoresponder.py
index d5dadae..41e811b 100644
--- a/lib/bridgedb/email/autoresponder.py
+++ b/lib/bridgedb/email/autoresponder.py
@@ -531,8 +531,14 @@ class SMTPAutoresponder(smtp.SMTPClient):
             error = fail
         logging.error(error)
 
-        # This handles QUIT commands, disconnecting, and closing the transport:
-        smtp.SMTPClient.sendError(self, fail)
+        try:
+            # This handles QUIT commands, disconnecting, and closing the
+            # transport:
+            smtp.SMTPClient.sendError(self, fail)
+        # We might not have `transport` and `protocol` attributes, depending
+        # on when and where the error occurred, so just catch and log it:
+        except Exception as error:
+            logging.error(error)
 
     def reply(self):
         """Reply to an incoming email. Maybe.
    
    
More information about the tor-commits
mailing list