]> git.openstreetmap.org Git - osqa.git/commitdiff
just pass AttributeError exceptions because their is a chance that a None object...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 26 Sep 2011 20:53:28 +0000 (20:53 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 26 Sep 2011 20:53:28 +0000 (20:53 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1178 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/utils/mail.py

index 8016b0034701deb5f5faf3d3d3c9f866adf57a39..84a79b35a876297fd0e0e9c5bff6ac605074378c 100644 (file)
@@ -94,12 +94,15 @@ def create_and_send_mail_messages(messages):
                 logging.error("Couldn't send mail using the sendmail method: %s" % e)
                 try:
                     connection.quit()
                 logging.error("Couldn't send mail using the sendmail method: %s" % e)
                 try:
                     connection.quit()
-                    connection = None
-                except Exception:
+                except Exception, e:
+                    logging.error(e)
+                finally:
                     connection = None
 
         try:
             connection.quit()
                     connection = None
 
         try:
             connection.quit()
+        except AttributeError:
+            pass
         except socket.sslerror:
             connection.close()
     except Exception, e:
         except socket.sslerror:
             connection.close()
     except Exception, e: