Better message for missing fields
Happens in projections, when trying to use a field that does not exist.
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user