Skip to content

Exceptions

exceptions

bidiwave exceptions.

BiDiError

Bases: Exception

Base for all bidiwave errors.

Source code in bidiwave/exceptions.py
class BiDiError(Exception):
    """Base for all bidiwave errors."""

    def __init__(self, message: str = "", code: str = "") -> None:
        super().__init__(message)
        self.code = code
        self.message = message

BiDiConnectionError

Bases: BiDiError

WebSocket connection error.

Source code in bidiwave/exceptions.py
class BiDiConnectionError(BiDiError):
    """WebSocket connection error."""

BiDiTimeoutError

Bases: BiDiError

Timeout waiting for response or navigation.

Source code in bidiwave/exceptions.py
class BiDiTimeoutError(BiDiError):
    """Timeout waiting for response or navigation."""

CapabilityError

Bases: BiDiError

The browser does not support the required capability.

Source code in bidiwave/exceptions.py
class CapabilityError(BiDiError):
    """The browser does not support the required capability."""

ProtocolError

Bases: BiDiError

Invalid or unexpected protocol message.

Source code in bidiwave/exceptions.py
class ProtocolError(BiDiError):
    """Invalid or unexpected protocol message."""

SessionError

Bases: BiDiError

Invalid or expired session.

Source code in bidiwave/exceptions.py
class SessionError(BiDiError):
    """Invalid or expired session."""

CommandError

Bases: BiDiError

The browser rejected a command.

Source code in bidiwave/exceptions.py
class CommandError(BiDiError):
    """The browser rejected a command."""

    def __init__(self, code: str, message: str) -> None:
        super().__init__(message=message, code=code)

InvalidArgumentError

Bases: CommandError

Invalid argument.

Source code in bidiwave/exceptions.py
class InvalidArgumentError(CommandError):
    """Invalid argument."""

NoSuchFrameError

Bases: CommandError

Context not found.

Source code in bidiwave/exceptions.py
class NoSuchFrameError(CommandError):
    """Context not found."""

NoSuchWindowError

Bases: CommandError

Window not found.

Source code in bidiwave/exceptions.py
class NoSuchWindowError(CommandError):
    """Window not found."""

JavaScriptError

Bases: CommandError

Error evaluating JavaScript.

Source code in bidiwave/exceptions.py
class JavaScriptError(CommandError):
    """Error evaluating JavaScript."""

InvalidSessionError

Bases: CommandError

Invalid or expired session.

Source code in bidiwave/exceptions.py
class InvalidSessionError(CommandError):
    """Invalid or expired session."""

SessionNotFoundError

Bases: CommandError

Session not found.

Source code in bidiwave/exceptions.py
class SessionNotFoundError(CommandError):
    """Session not found."""

UnableToCaptureScreenError

Bases: CommandError

Unable to capture screen.

Source code in bidiwave/exceptions.py
class UnableToCaptureScreenError(CommandError):
    """Unable to capture screen."""

UnknownCommandError

Bases: CommandError

Unknown command.

Source code in bidiwave/exceptions.py
class UnknownCommandError(CommandError):
    """Unknown command."""

UnsupportedOperationError

Bases: CommandError

Unsupported operation.

Source code in bidiwave/exceptions.py
class UnsupportedOperationError(CommandError):
    """Unsupported operation."""

NoSuchElementError

Bases: CommandError

Element not found.

Source code in bidiwave/exceptions.py
class NoSuchElementError(CommandError):
    """Element not found."""

NoSuchCookieError

Bases: CommandError

Cookie not found.

Source code in bidiwave/exceptions.py
class NoSuchCookieError(CommandError):
    """Cookie not found."""

StaleElementReferenceError

Bases: CommandError

Element reference is stale.

Source code in bidiwave/exceptions.py
class StaleElementReferenceError(CommandError):
    """Element reference is stale."""

ElementNotInteractableError

Bases: CommandError

Element not interactable.

Source code in bidiwave/exceptions.py
class ElementNotInteractableError(CommandError):
    """Element not interactable."""

InsecureCertificateError

Bases: CommandError

Insecure certificate.

Source code in bidiwave/exceptions.py
class InsecureCertificateError(CommandError):
    """Insecure certificate."""

MoveTargetOutOfBoundsError

Bases: CommandError

Move target out of bounds.

Source code in bidiwave/exceptions.py
class MoveTargetOutOfBoundsError(CommandError):
    """Move target out of bounds."""

NoSuchAlertError

Bases: CommandError

No such alert.

Source code in bidiwave/exceptions.py
class NoSuchAlertError(CommandError):
    """No such alert."""

NoSuchShadowRootError

Bases: CommandError

No such shadow root.

Source code in bidiwave/exceptions.py
class NoSuchShadowRootError(CommandError):
    """No such shadow root."""

DetachedShadowRootError

Bases: CommandError

Detached shadow root.

Source code in bidiwave/exceptions.py
class DetachedShadowRootError(CommandError):
    """Detached shadow root."""

InvalidWebExtensionError

Bases: CommandError

Invalid web extension.

Source code in bidiwave/exceptions.py
class InvalidWebExtensionError(CommandError):
    """Invalid web extension."""

NoSuchUserContextError

Bases: CommandError

No such user context.

Source code in bidiwave/exceptions.py
class NoSuchUserContextError(CommandError):
    """No such user context."""

SessionNotCreatedError

Bases: CommandError

Session not created.

Source code in bidiwave/exceptions.py
class SessionNotCreatedError(CommandError):
    """Session not created."""

ProtocolTimeoutError

Bases: CommandError

Protocol-level timeout error from the browser.

Source code in bidiwave/exceptions.py
class ProtocolTimeoutError(CommandError):
    """Protocol-level timeout error from the browser."""

map_error

map_error(code: str, message: str) -> CommandError

Maps a BiDi error code to the correct exception.

Source code in bidiwave/exceptions.py
def map_error(code: str, message: str) -> CommandError:
    """Maps a BiDi error code to the correct exception."""
    error_cls = ERROR_CODE_MAP.get(code, CommandError)
    return error_cls(code=code, message=message)