__all__ = [
"RemoteBlockedError",
"ResponseNotFound",
"MalformedUrl",
"InterceptorNotFound",
"DatabaseNotFound",
]
[docs]
class RemoteBlockedError(RuntimeError):
"""
Exception raised when Remote connections are blocked.
"""
def __init__(self, reason="A test tried to connect to internet.", *args, **kwargs):
super(RemoteBlockedError, self).__init__(reason, *args, **kwargs)
[docs]
class ResponseNotFound(RuntimeError):
"""
Exception raised when response is not locally available.
"""
def __init__(self, reason="Response is not available; try capturing first.", *args, **kwargs):
super(ResponseNotFound, self).__init__(reason, *args, **kwargs)
[docs]
class InterceptorNotFound(ModuleNotFoundError):
"""
Exception raised when the requested interceptor is not available.
"""
def __init__(self, reason="Interceptor not available; check `Response.available`", *args, **kwargs):
super().__init__(reason, *args, **kwargs)
pass
[docs]
class DatabaseNotFound(Exception):
"""
Exception raised when database is not initialized properly.
"""
def __init__(
self, reason="Database not initialized; use ``Response.setup_database``", *args, **kwargs
) -> None:
super().__init__(reason, *args, **kwargs)