From: Robert Leftwich Date: Thu, 12 Jan 2006 07:33:28 +0000 (+0000) Subject: r818@lightspeed: robert | 2006-01-12 18:32:38 +1100 X-Git-Tag: rel_0_1_0~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3075174c49b838611499cc77b8345fec8e1e7911;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git r818@lightspeed: robert | 2006-01-12 18:32:38 +1100 Added class name to the TypeError string to make it easier to find constructor problems when mapper is constructing complex mappings --- diff --git a/lib/sqlalchemy/mapping/mapper.py b/lib/sqlalchemy/mapping/mapper.py index a1a3ee5fb3..ff0f1fc878 100644 --- a/lib/sqlalchemy/mapping/mapper.py +++ b/lib/sqlalchemy/mapping/mapper.py @@ -215,7 +215,11 @@ class Mapper(object): def init(self, *args, **kwargs): nohist = kwargs.pop('_mapper_nohistory', False) if oldinit is not None: - oldinit(self, *args, **kwargs) + try: + oldinit(self, *args, **kwargs) + except TypeError, msg: + # re-raise with the offending class name added to help in debugging + raise TypeError, '%s.%s' %(self.__class__.__name__, msg) if not nohist: objectstore.uow().register_new(self) self.class_.__init__ = init