]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Updated exception messaging for r4220
authorJason Kirtland <jek@discorporate.us>
Tue, 4 Mar 2008 21:35:15 +0000 (21:35 +0000)
committerJason Kirtland <jek@discorporate.us>
Tue, 4 Mar 2008 21:35:15 +0000 (21:35 +0000)
lib/sqlalchemy/sql/expression.py
test/engine/bind.py

index 9fb0e596ae0915490a55d8cac1854f4bd9e838b0..8e2a13e7cebc34bbff371ebba7b6e9703fdd95aa 100644 (file)
@@ -1001,11 +1001,11 @@ class ClauseElement(object):
         e = self.bind
         if e is None:
             label = getattr(self, 'description', self.__class__.__name__)
-            msg = ('This %s is not bound to an Engine or Connection.  '
-                   'Execution can not proceed without a database to execute '
-                   'against.  Either execute with an explicit connection or '
-                   'bind the MetaData of the underlying tables to enable '
-                   'implicit execution.') % label
+            msg = ('This %s is not bound and does not support direct '
+                   'execution. Supply this statement to a Connection or '
+                   'Engine for execution. Or, assign a bind to the statement '
+                   'or the Metadata of its underlying tables to enable '
+                   'implicit execution via this method.' % label)
             raise exceptions.UnboundExecutionError(msg)
         return e.execute_clauseelement(self, multiparams, params)
 
index db4955375db56831bea94273db80dedd07f39e28..b59cd284a19f94cba7ee30ba4779e9f6407ec18d 100644 (file)
@@ -203,12 +203,11 @@ class BindTest(TestBase):
                     assert False
                 except exceptions.UnboundExecutionError, e:
                     assert str(e).endswith(
-                        'is not bound to an Engine or '
-                        'Connection.  Execution can not proceed without a '
-                        'database to execute against.  Either execute with '
-                        'an explicit connection or bind the MetaData of the '
-                        'underlying tables to enable implicit execution.')
-
+                        'is not bound and does not support direct '
+                        'execution. Supply this statement to a Connection or '
+                        'Engine for execution. Or, assign a bind to the '
+                        'statement or the Metadata of its underlying tables to '
+                        'enable implicit execution via this method.')
         finally:
             if isinstance(bind, engine.Connection):
                 bind.close()