'''
exceptions.py: exceptions defined by eprints2archives

Authors
-------

Michael Hucka <mhucka@caltech.edu> -- Caltech Library

Copyright
---------

Copyright (c) 2020-2021 by the California Institute of Technology.  This code
is open-source software released under a 3-clause BSD license.  Please see the
file "LICENSE" for more information.
'''


# Base class.
# .............................................................................
# The base class makes it possible to use a single test to distinguish between
# exceptions generated by eprints2archives code and exceptions generated by
# something else.

class Eprints2ArchivesException(Exception):
    '''Base class for eprints2archives exceptions.'''
    pass


# Exception classes.
# .............................................................................

class CannotProceed(Eprints2ArchivesException):
    '''A recognizable condition caused an early exit from the program.'''
    pass

class UserCancelled(Eprints2ArchivesException):
    '''The user elected to cancel/quit the program.'''
    pass

class CorruptedContent(Eprints2ArchivesException):
    '''Content corruption has been detected.'''
    pass

class ServerError(Eprints2ArchivesException):
    '''Unrecoverable problem involving the EPrints server.'''
    pass

class InternalError(Eprints2ArchivesException):
    '''Unrecoverable problem involving eprints2archives itself.'''
    pass
