enhance error message

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset0e27cf112c97
branchdefault
phasepublic
hiddenno
parent revision#12978e52f712 merge back stable changes
child revision#6b9b6c81b9c5 pass a dbhelper to sqldropschema2sql to handle db specificities (closes #77664)
files modified by this revision
buildobjs.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1317717231 -7200
# Tue Oct 04 10:33:51 2011 +0200
# Node ID 0e27cf112c97d0b76517a5dca4ae90a5db6049f2
# Parent 12978e52f7126fa3655731c84bd6dc0d64a890c5
enhance error message

diff --git a/buildobjs.py b/buildobjs.py
@@ -492,11 +492,12 @@
1              _copy_attributes(rtype, defined[name], RTYPE_PROPERTIES)
2          else:
3              defined[name] = rtype
4          key = (cls.subject, name, cls.object)
5          if key in defined:
6 -            raise BadSchemaDefinition('duplicated %s' % cls)
7 +            raise BadSchemaDefinition('duplicated relation definition %s (%s.%s)'
8 +                                      % (key, cls.__module__, cls.__name__))
9          defined[key] = cls
10 
11      @classmethod
12      def expand_relation_definitions(cls, defined, schema):
13          """schema building step 2: