Source code for quantum_launcher.exceptions

 1""" Module for different exceptions used by quantum_launcher. """
 2
 3
[docs] 4class DependencyError(ImportError): 5 """ Error connected with missing optional dependencies and wrong installation. """ 6 7 def __init__(self, e: ImportError, install_hint: str = '', *, private: bool = False) -> None: 8 if private: 9 message = f"""Module "{e.name}" is required but not installed. """ + \ 10 """The module needs to be installed but it's private. """ + \ 11 """To get access to module contact the library developers.""" 12 else: 13 message = f"""Module "{e.name}" is required but not installed. Install it with: pip install "quantum_launcher[{install_hint}]".""" 14 super().__init__(message, name=e.name)