Commit 5d7350e5 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added keys to some KeyErrors.

parent 8a586df1
Pipeline #71518 passed with stages
in 13 minutes and 40 seconds
......@@ -1550,7 +1550,7 @@ class MSection(metaclass=MObjectMeta): # TODO find a way to make this a subclas
key = key.replace('.', '/')
return self.m_resolve(key)
except ReferenceError:
raise KeyError()
raise KeyError(key)
def __iter__(self):
return self.m_def.all_properties.__iter__()
......
......@@ -130,7 +130,7 @@ class MongoDocument(SectionAnnotation):
'''
mongo_instance = self.objects(**kwargs).first()
if mongo_instance is None:
raise KeyError()
raise KeyError(str(kwargs))
return self.to_metainfo(mongo_instance)
def to_metainfo(self, mongo_instance):
......
......@@ -458,7 +458,7 @@ class Backend(AbstractParserBackend):
value = section.m_get(quantity_def)
if value is None:
raise KeyError()
raise KeyError(quantity_def.name)
if isinstance(quantity_def.type, Reference):
return value.m_parent_index
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment