INNER CODE UNIT · Python
MechanismNotSupportedError
open-quantum-safe/liboqs-python · oqs/oqs.py:328
class MechanismNotSupportedError(Exception):
"""Exception raised when an algorithm is not supported by OQS."""
def __init__(self, alg_name: str, supported: Optional[Iterable[str]] = None) -> None:
"""
Initialize the exception.
:param alg_name: Requested algorithm name.
:param supported: A list of supported algorithms to include in the message.
Defaults to `None`.
"""
supported_str = ""
if supported is not None:
supported_str = ", ".join(supported)
supported_str = f". Supported algorithms: {supported_str}"
self.alg_name = alg_name
self.message = f"{alg_name} is not supported by OQS" + supported_str