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

Class EncryptionError

pymongo/errors.py:388–410  ·  view source on GitHub ↗

Raised when encryption or decryption fails. This error always wraps another exception which can be retrieved via the :attr:`cause` property. .. versionadded:: 3.9

Source from the content-addressed store, hash-verified

386
387
388class EncryptionError(PyMongoError):
389 """Raised when encryption or decryption fails.
390
391 This error always wraps another exception which can be retrieved via the
392 :attr:`cause` property.
393
394 .. versionadded:: 3.9
395 """
396
397 def __init__(self, cause: Exception) -> None:
398 super().__init__(str(cause))
399 self.__cause = cause
400
401 @property
402 def cause(self) -> Exception:
403 """The exception that caused this encryption or decryption error."""
404 return self.__cause
405
406 @property
407 def timeout(self) -> bool:
408 if isinstance(self.__cause, PyMongoError):
409 return self.__cause.timeout
410 return False
411
412
413class EncryptedCollectionError(EncryptionError):

Callers 3

_wrap_encryption_errorsFunction · 0.90
_wrap_encryption_errorsFunction · 0.90

Calls

no outgoing calls

Tested by 1