MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _wrap_encryption_errors

Function _wrap_encryption_errors

pymongo/synchronous/encryption.py:126–135  ·  view source on GitHub ↗

Context manager to wrap encryption related errors.

()

Source from the content-addressed store, hash-verified

124
125@contextlib.contextmanager
126def _wrap_encryption_errors() -> Iterator[None]:
127 """Context manager to wrap encryption related errors."""
128 try:
129 yield
130 except BSONError:
131 # BSON encoding/decoding errors are unrelated to encryption so
132 # we should propagate them unchanged.
133 raise
134 except Exception as exc:
135 raise EncryptionError(exc) from exc
136
137
138class _EncryptionIO(MongoCryptCallback): # type: ignore[misc]

Callers 6

encryptMethod · 0.70
decryptMethod · 0.70
create_data_keyMethod · 0.70
_encrypt_helperMethod · 0.70
decryptMethod · 0.70
rewrap_many_data_keyMethod · 0.70

Calls 1

EncryptionErrorClass · 0.90

Tested by

no test coverage detected