Field name lookup: improve error message

This commit is contained in:
Doug Blank 2016-04-30 10:47:50 -04:00
parent 8f77d6db9f
commit db6cd7e318

View File

@ -215,7 +215,7 @@ class BasicPrimaryObject(TableObject, PrivacyBase, TagBase):
elif part in schema.keys():
path = schema[part]
else:
raise Exception("No such '%s' in %s" % (part, list(schema.keys())))
raise Exception("No such field. Valid fields are: %s" % list(schema.keys()))
if isinstance(path, (list, tuple)):
path = path[0]
return path