adb.usb_exceptions module

Common exceptions for ADB and Fastboot.

Contents

exception adb.usb_exceptions.AdbCommandFailureException[source]

Bases: Exception

ADB Command returned a FAIL.

_images/adb.usb_exceptions.AdbCommandFailureException.CALL_GRAPH.svg
exception adb.usb_exceptions.AdbOperationException[source]

Bases: Exception

Failed to communicate over adb with device after multiple retries.

_images/adb.usb_exceptions.AdbOperationException.CALL_GRAPH.svg
exception adb.usb_exceptions.CommonUsbError[source]

Bases: Exception

Base class for usb communication errors.

_images/adb.usb_exceptions.CommonUsbError.CALL_GRAPH.svg
exception adb.usb_exceptions.DeviceAuthError(message, *args)[source]

Bases: adb.usb_exceptions.FormatMessageWithArgumentsException

Device authentication failed.

_images/adb.usb_exceptions.DeviceAuthError.CALL_GRAPH.svg
exception adb.usb_exceptions.DeviceNotFoundError(message, *args)[source]

Bases: adb.usb_exceptions.FormatMessageWithArgumentsException

Device isn’t on USB.

_images/adb.usb_exceptions.DeviceNotFoundError.CALL_GRAPH.svg
exception adb.usb_exceptions.FormatMessageWithArgumentsException(message, *args)[source]

Bases: adb.usb_exceptions.CommonUsbError

Exception that both looks good and is functional.

Okay, not that kind of functional, it’s still a class.

This interpolates the message with the given arguments to make it human-readable, but keeps the arguments in case other code try-excepts it.

_images/adb.usb_exceptions.FormatMessageWithArgumentsException.CALL_GRAPH.svg
Parameters
  • message (str) – The error message

  • args (str) – Positional arguments for formatting message

exception adb.usb_exceptions.LibusbWrappingError(msg, usb_error)[source]

Bases: adb.usb_exceptions.CommonUsbError

Wraps libusb1 errors while keeping their original usefulness.

_images/adb.usb_exceptions.LibusbWrappingError.CALL_GRAPH.svg
Parameters
  • msg (str) – The error message

  • usb_error (libusb1.USBError) – An exception from libusb1

usb_error

An exception from libusb1

Type

libusb1.USBError

exception adb.usb_exceptions.ReadFailedError(msg, usb_error)[source]

Bases: adb.usb_exceptions.LibusbWrappingError

Raised when the device doesn’t respond to our commands.

_images/adb.usb_exceptions.ReadFailedError.CALL_GRAPH.svg
exception adb.usb_exceptions.TcpTimeoutException(message, *args)[source]

Bases: adb.usb_exceptions.FormatMessageWithArgumentsException

TCP connection timed out in the time out given.

_images/adb.usb_exceptions.TcpTimeoutException.CALL_GRAPH.svg
exception adb.usb_exceptions.WriteFailedError(msg, usb_error)[source]

Bases: adb.usb_exceptions.LibusbWrappingError

Raised when the device doesn’t accept our command.

_images/adb.usb_exceptions.WriteFailedError.CALL_GRAPH.svg