Better message for missing fields

Happens in projections, when trying to use a field that does not exist.
This commit is contained in:
Salvo 'LtWorf' Tomaselli
2016-03-31 21:28:23 +02:00
parent 72318bb0e8
commit 7661d21da2

View File

@@ -531,7 +531,10 @@ class Header(tuple):
def getAttributesId(self, param): def getAttributesId(self, param):
'''Returns a list with numeric index corresponding to field's name''' '''Returns a list with numeric index corresponding to field's name'''
return [self.index(i) for i in param] try:
return [self.index(i) for i in param]
except ValueError as e:
raise Exception('One of the fields is not in the relation: %s' % ','.join(param))
# Backwards compatibility # Backwards compatibility
relation = Relation relation = Relation