diff --git a/src/oaipmh_scythe/exceptions.py b/src/oaipmh_scythe/exceptions.py index 4218dfd..ab58b98 100644 --- a/src/oaipmh_scythe/exceptions.py +++ b/src/oaipmh_scythe/exceptions.py @@ -5,44 +5,44 @@ """Custom exceptions for OAI-PMH related errors.""" -class OAIPMHError(Exception): +class OAIPMHException(Exception): """Base exception for all OAI-PMH related errors.""" -class BadArgument(OAIPMHError): +class BadArgument(OAIPMHException): """The request includes illegal arguments, is missing required arguments, includes a repeated argument, or values for arguments have an illegal syntax.""" -class BadVerb(OAIPMHError): +class BadVerb(OAIPMHException): """Value of the verb argument is not a legal OAI-PMH verb, the verb argument is missing, or the verb argument is repeated.""" -class BadResumptionToken(OAIPMHError): +class BadResumptionToken(OAIPMHException): """The value of the resumptionToken argument is invalid or expired.""" -class CannotDisseminateFormat(OAIPMHError): +class CannotDisseminateFormat(OAIPMHException): """The metadata format identified by the value given for the metadataPrefix argument is not supported by the item or by the repository.""" -class IdDoesNotExist(OAIPMHError): +class IdDoesNotExist(OAIPMHException): """The value of the identifier argument is unknown or illegal in this repository.""" -class NoSetHierarchy(OAIPMHError): +class NoSetHierarchy(OAIPMHException): """The repository does not support sets.""" -class NoMetadataFormat(OAIPMHError): +class NoMetadataFormat(OAIPMHException): """There are no metadata formats available for the specified item.""" -class NoRecordsMatch(OAIPMHError): +class NoRecordsMatch(OAIPMHException): """The combination of the values of the from, until, set and metadataPrefix arguments results in an empty list.""" -class OAIError(OAIPMHError): - """Context specific OAI errors not covered by the classes above.""" +class GeneralOAIPMHError(OAIPMHException): + """General exception for context-specific OAI-PMH errors not covered by the other specific classes.""" diff --git a/src/oaipmh_scythe/iterator.py b/src/oaipmh_scythe/iterator.py index 4407a66..3acdad2 100644 --- a/src/oaipmh_scythe/iterator.py +++ b/src/oaipmh_scythe/iterator.py @@ -81,7 +81,7 @@ def _next_response(self) -> None: exception_name = code[0].upper() + code[1:] raise getattr(exceptions, exception_name)(description) except AttributeError as exc: - raise exceptions.OAIError(description) from exc + raise exceptions.GeneralOAIPMHError(description) from exc self.resumption_token = self._get_resumption_token()