Commit fa1cf291 authored by Yury's avatar Yury

document: suppress exceptions stack trace

parent d568e680
Pipeline #343 passed with stages
in 4 minutes
......@@ -64,7 +64,7 @@ class DocumentField:
return self.document_cls is other.document_cls and ==
except AttributeError:
raise TypeError(f"Can't compare {other} to DocumentField.")
raise TypeError(f"Can't compare {other} to DocumentField.") from None
class DocumentRelations:
......@@ -200,7 +200,7 @@ class Document(metaclass=MetaDocument):
return DocumentArray(self._document_[item])
return self._document_[item]
except KeyError:
raise AttributeError(item)
raise AttributeError(item) from None
def __setattr__(self, key, value):
self._document_[key] = value
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment