"""$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/dulcinea/lib/errors.py $
$Id: errors.py 23268 2003-12-04 12:26:43Z dbinger $

Provides DulcineaError, the root class for all Dulcinea exception
classes.  Also provides the Dulcinea specific exception classes.
"""
import quixote.errors

class DulcineaError (Exception):
    """The root of all evil; all exception classes defined in the Dulcinea
    package should subclass from it.

    Could be used to provide common error-handling mechanisms, but for
    now it's just a trivial, empty exception class.

    Instance attributes: none
    """

class UsageError (DulcineaError):
    """Raised when a class is used inappropriately or incorrectly, eg.
    when operations are called out of order or some prerequisite is
    not met.

    Instance attributes: none
    """

class ConflictError (DulcineaError):
    """Raised when a database conflict error is discovered,
    eg. attempting to add a user whose user ID is already in use.

    Instance attributes: none
    """

class NotLoggedInError(quixote.errors.AccessError, DulcineaError):
    """Raised when access is denied because the user should be signed in.

    Instance attributes: none
    """
