Source code for ardurpc.exception

"""
ArduRPC exceptions.

* Failure

  * FunctionNotFound
  * HandlerNotFound
  * CommandNotFound

* Timeout

"""


[docs]class ArduRPCException(Exception): """Base ArduRPC Exception.""" def __init__(self, value=""): Exception.__init__(self) self.value = value def __str__(self): return repr(self.value)
[docs]class Failure(ArduRPCException): """ Something went wrong while executing a command. But no reason was given. """ pass
[docs]class FunctionNotFound(Failure): """The function is not available on the microcontroller.""" pass
[docs]class HandlerNotFound(Failure): """The handler is not available on the microcontroller.""" pass
[docs]class InvalidHeader(Failure): """The header was malformed""" pass
[docs]class InvalidRequest(Failure): """The request was malformed""" pass
[docs]class CommandNotFound(Failure): """The command is not available on the microcontroller.""" pass
[docs]class UnknownReturnCode(Failure): """.""" pass
[docs]class Timeout(ArduRPCException): """A timeout occurred.""" pass