summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Perkins <john.d.perkins@gmail.com>2016-08-05 13:45:49 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-09-20 12:11:11 -0400
commite95aa257aa3145a5db478d33fb1803494a38b46d (patch)
tree1e235379669c56444d21a3fa50b1e91d008686db /lib
parent881369b949cff44e0017fdc28d9722ef3c26171a (diff)
downloadsqlalchemy-e95aa257aa3145a5db478d33fb1803494a38b46d.tar.gz
Add the "triggering mapper" to the configure_mappers error message.
There are cases where the originating mapper name is not present in the exception message, such as relationship initialization against an unmapped class. Ensure the originating mapper is named in the string output. Pull-request: https://github.com/zzzeek/sqlalchemy/pull/298 Change-Id: I9f23bfa90b26dde9229ab7ec812eec9ceae48153
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/mapper.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index e8aa08541..b8dc5b8c3 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -2833,8 +2833,9 @@ def configure_mappers():
e = sa_exc.InvalidRequestError(
"One or more mappers failed to initialize - "
"can't proceed with initialization of other "
- "mappers. Original exception was: %s"
- % mapper._configure_failed)
+ "mappers. Triggering mapper: '%s'. "
+ "Original exception was: %s"
+ % (mapper, mapper._configure_failed))
e._configure_failed = mapper._configure_failed
raise e
if not mapper.configured: