[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [gettor/master] Treat all email sending exceptions the same



commit fc9e1ed212d54cf682601a1caaa7e289a43d50cf
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
Date:   Sun Mar 7 19:15:21 2021 -0500

    Treat all email sending exceptions the same
    
    In the previous commit, we forgot to remove requests that trigger
    exceptions other than SMTPClientError.
---
 gettor/services/email/sendmail.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/gettor/services/email/sendmail.py b/gettor/services/email/sendmail.py
index 869373d..9c703f3 100644
--- a/gettor/services/email/sendmail.py
+++ b/gettor/services/email/sendmail.py
@@ -230,14 +230,9 @@ class Sendmail(object):
                     id=id, service="email", date=date
                 )
 
-        except smtp.SMTPClientError as e:
+        except Exception as e:
             yield self.conn.remove_request(
                 id=id, service="email", date=date
             )
             log.error(strings.redact_emails(
                 "Error sending email to {}:{}.".format(id, e)))
-
-        except Exception as e:
-            log.error(
-                strings.redact_emails("Error sending email:{}.".format(e))
-                )

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits