Source code for mcbootflash.error

"""Exceptions raised by mcbootflash."""

[docs]class BootloaderError(Exception): """Base class for mcbootflash exceptions. Subclasses must map to a specific error response code. """
[docs]class UnsupportedCommand(BootloaderError): """Raised if Response.success is ResponseCode.UNSUPPORTED_COMMAND. This means that the bootloader did not recognize the most recently sent command. """
[docs]class BadAddress(BootloaderError): """Raised if Response.success is ResponseCode.BAD_ADDRESS. This means an operation was attempted outside of the program memory range. """
[docs]class BadLength(BootloaderError): """Raised if Response.success is ResponseCode.BAD_LENGTH. This means that the size of the command packet plus associated data was greater than permitted. """
[docs]class VerifyFail(BootloaderError): """Raised if Response.success is ResponseCode.VERIFY_FAIL. This means that no program was detected in the program memory range. """