Skip to main content

reraise_errors

Context reraising crypto errors as :exc:SecurityError.

def reraise_errors(
msg: string = '{0!r}',
errors: tuple = null
) - > contextmanager

Context reraising crypto errors as :exc:SecurityError.

Parameters

NameTypeDescription
msgstring = '{0!r}'A format string used to construct the SecurityError message, where {0} is replaced by the caught exception.
errorstuple = nullA tuple of exception classes to catch and reraise; defaults to cryptography.exceptions if not provided.

Returns

TypeDescription
contextmanagerA context manager that wraps the execution block to intercept and re-package specific exceptions.