dabo Commit
Revision 4538
Date: 2008-10-02 07:00:25 -0700 (Thu, 02 Oct 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4538
Changed:
U trunk/ide/CxnEditor.py
Log:
Improved the reporting of errors when a connection test fails. The prior
confusion was the result of a bare except handler that treated all failures
identically. Now ImportErrors will be reported accurately, and conneciton
errors will also provide better information.
Diff:
Modified: trunk/ide/CxnEditor.py
===================================================================
--- trunk/ide/CxnEditor.py 2008-10-02 02:36:29 UTC (rev 4537)
+++ trunk/ide/CxnEditor.py 2008-10-02 14:00:25 UTC (rev 4538)
@@ -273,19 +273,20 @@
self.updtFromForm()
# Create a connection object.
ci =
dabo.db.dConnectInfo(connInfo=self.connDict[self.currentConn])
+ mb = dui.stop
+ mbTitle = _("Connection Test")
try:
conn = ci.getConnection()
conn.close()
- except:
- conn = None
-
- if conn:
msg = _("The connection was successful!")
mb = dui.info
- else:
- msg = _("Unable to make connection")
- mb = dui.stop
- mb(message=msg, title="Connection Test")
+ except ImportError, e:
+ msg = _("Python Import Error: %s") % e
+ mbTitle += _(": FAILED!")
+ except StandardError, e:
+ msg = _("Could not connect to the database: %s") % e
+ mbTitle += _(": FAILED!")
+ mb(message=msg, title=mbTitle)
def updtFromForm(self):
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]