From 064f82986ca3573b124fc88518e99d3d43874b61 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 8 Dec 2017 18:08:40 -0500 Subject: Implement an error lookup Add codes to commonly raised error messages and classes that link back to fixed documentation sections giving background on these messages. Change-Id: I78d0660add7026bb662e20305a59283b20616954 --- lib/sqlalchemy/sql/compiler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 9ed75ca06..cb058affa 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -271,7 +271,7 @@ class Compiled(object): if e is None: raise exc.UnboundExecutionError( "This Compiled object is not bound to any Engine " - "or Connection.") + "or Connection.", code="2afi") return e._execute_compiled(self, multiparams, params) def scalar(self, *multiparams, **params): @@ -540,11 +540,11 @@ class SQLCompiler(Compiled): raise exc.InvalidRequestError( "A value is required for bind parameter %r, " "in parameter group %d" % - (bindparam.key, _group_number)) + (bindparam.key, _group_number), code="cd3x") else: raise exc.InvalidRequestError( "A value is required for bind parameter %r" - % bindparam.key) + % bindparam.key, code="cd3x") elif bindparam.callable: pd[name] = bindparam.effective_value @@ -559,11 +559,11 @@ class SQLCompiler(Compiled): raise exc.InvalidRequestError( "A value is required for bind parameter %r, " "in parameter group %d" % - (bindparam.key, _group_number)) + (bindparam.key, _group_number), code="cd3x") else: raise exc.InvalidRequestError( "A value is required for bind parameter %r" - % bindparam.key) + % bindparam.key, code="cd3x") if bindparam.callable: pd[self.bind_names[bindparam]] = bindparam.effective_value -- cgit v1.2.1