Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
flockwave-server / server / model / errors.py
Size: Mime:
"""Error classes specific to the Flockwave model."""

from builtins import str

from flockwave.server.errors import FlockwaveError

__all__ = ("ClientNotSubscribedError", "NoSuchPathError")


class ClientNotSubscribedError(FlockwaveError):
    """Error thrown when a client attempts to unsubscribe from a part of the
    device tree that it is not subscribed to.
    """

    def __init__(self, client, path):
        """Constructor.

        Parameters:
            client (Client): the client that attempted to unsubscribe
            path (DeviceTreePath): the path that the client attempted to
                unsubscribe from
        """
        super(ClientNotSubscribedError, self).__init__(str(client))
        self.client = client
        self.path = path


class NoSuchPathError(FlockwaveError):
    """Error thrown when the device tree failed to resolve a device tree
    path to a corresponding node.
    """

    def __init__(self, path):
        """Constructor.

        Parameters:
            path (DeviceTreePath): the path that could not be resolved into
                a node
        """
        super(NoSuchPathError, self).__init__(str(path))
        self.path = path