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

Function _wrap_encryption_errors

pymongo/asynchronous/encryption.py:127–136  ·  view source on GitHub ↗

Context manager to wrap encryption related errors.

()

Source from the content-addressed store, hash-verified

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