Author: ianb
Date: 2004-09-22 18:28:41 -0400 (Wed, 22 Sep 2004)
New Revision: 218
Modified:
trunk/SQLObject/sqlobject/postgres/pgconnection.py
Log:
provide a better error message when having connection problems
Modified: trunk/SQLObject/sqlobject/postgres/pgconnection.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/SQLObject/sqlobject/postgres/pgconnection.py 2004-09-22 00:24:4=
4 UTC (rev 217)
+++ trunk/SQLObject/sqlobject/postgres/pgconnection.py 2004-09-22 22:28:4=
1 UTC (rev 218)
@@ -49,7 +49,10 @@
conn.autocommit(auto)
=20
def makeConnection(self):
- conn =3D self.pgmodule.connect(self.dsn)
+ try:
+ conn =3D self.pgmodule.connect(self.dsn)
+ except self.pgmodule.OperationalError, e:
+ raise self.pgmodule.OperationalError("%s; used connection st=
ring %r" % (e, self.dsn))
if self.autoCommit:
conn.autocommit(1)
return conn
|