Raised when trying to create a BSON object from an invalid document.
| 31 | |
| 32 | |
| 33 | class InvalidDocument(BSONError): |
| 34 | """Raised when trying to create a BSON object from an invalid document.""" |
| 35 | |
| 36 | def __init__(self, message: str, document: Optional[Any] = None) -> None: |
| 37 | super().__init__(message) |
| 38 | self._document = document |
| 39 | |
| 40 | @property |
| 41 | def document(self) -> Any: |
| 42 | """The invalid document that caused the error. |
| 43 | |
| 44 | ..versionadded:: 4.16""" |
| 45 | return self._document |
| 46 | |
| 47 | |
| 48 | class InvalidId(BSONError): |
no outgoing calls
no test coverage detected