"""$URL: svn://svn/repos/trunk/dulcinea/lib/errors.py $
$Id: errors.py 20912 2003-03-04 16:07:12Z dbinger $

Provides DulcineaError, the root class for all Dulcinea exception
classes.  Also provides the Dulcinea specific exception classes.


"""

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 DatabaseError (DulcineaError):
    """Raised on a detected database inconsistency or when an operation
    would create an inconsistency.

    Instance attributes: none
    """

class InternalError (DulcineaError):
    """Internal inconsistency or "impossible" situation.  Should never
    be raised in bug-free code, ie. if a bad situation could arise due
    to the actions of outside code, this is not the right exception to
    raise.  Alternately: if a bad situation is almost certainly the
    fault of code in the current module, this exception is appropriate.

    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 (DatabaseError):
    """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 AccessError (DulcineaError):
    """Access control violation: raised when someone tries to access
    or modify data that they do not have permission to access
    or modify.

    Instance attributes: none
    """
