Skip to content

Commit 4fb872e

Browse files
committed
Address review
1 parent cc07a59 commit 4fb872e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

bson/errors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def __init__(self, message: str, document: Optional[Any] = None) -> None:
3939

4040
@property
4141
def document(self) -> Any:
42-
"""The invalid document that caused the error."""
42+
"""The invalid document that caused the error.
43+
44+
..versionadded:: 4.16"""
4345
return self._document
4446

4547
@document.setter

doc/changelog.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=========
33

4+
Changes in Version 4.16.0 (XXXX/XX/XX)
5+
--------------------------------------
6+
7+
PyMongo 4.16 brings a number of changes including:
8+
9+
- Removed invalid documents from :class:`bson.errors.InvalidDocument` error messages as
10+
doing so may leak sensitive user data.
11+
Instead, invalid documents are stored in :attr:`bson.errors.InvalidDocument.document`.
12+
413
Changes in Version 4.15.1 (2025/09/16)
514
--------------------------------------
615

0 commit comments

Comments
 (0)