Title: [commits] (bkirsch) [11196] addresses bug 6222: IMAP and POP over SSL fail silently when host mismatch.
Revision
11196
Author
bkirsch
Date
2006-07-18 16:03:12 -0700 (Tue, 18 Jul 2006)

Log Message

addresses bug 6222: IMAP and POP over SSL fail silently when host mismatch. This patch moves the conversion of error text from str to unicode to after SSL dialog code processing and adds a check for a TypeError exception

Modified Paths

Diff

Modified: trunk/chandler/parcels/osaf/mail/base.py (11195 => 11196)

--- trunk/chandler/parcels/osaf/mail/base.py	2006-07-18 22:52:43 UTC (rev 11195)
+++ trunk/chandler/parcels/osaf/mail/base.py	2006-07-18 23:03:12 UTC (rev 11196)
@@ -296,15 +296,9 @@
 
             err = err.value
 
+        #Get the str representation of Python class
         errorType   = str(err.__class__)
 
-        #Convert error messages to unicode objects for display
-        try:
-            errorText = unicode(err.__str__(), 'utf8', 'replace')
-        except UnicodeEncodeError, e:
-            logging.exception("Unable to convert Exception string text to Unicode")
-            errorText = u""
-
         if self.testing:
             reconnect = self.testAccountSettings
         else:
@@ -314,7 +308,6 @@
             #does not leverage the status bar.
             NotifyUIAsync(u"")
 
-
         if isinstance(err, Utility.CertificateVerificationError):
             assert err.args[1] == 'certificate verify failed'
 
@@ -346,6 +339,14 @@
             self._actionCompleted()
             return
 
+        #Convert error messages to unicode objects for display
+        try:
+            errorText = unicode(err.__str__(), 'utf8', 'replace')
+        except (UnicodeEncodeError, TypeError), e:
+            logging.exception("Unable to convert Exception string text to Unicode")
+            #XXX If the conversion fails add a more detailed message
+            # such "Please look at log to view the error"
+            errorText = u""
 
         if self.testing:
             alert(constants.TEST_ERROR, {'accountName': self.account.displayName, \




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to