Island: Add RepositoryError

This commit is contained in:
Mike Salvatore 2022-09-28 12:21:41 -04:00
parent e374341ce1
commit 3c2ee32bdf
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,4 @@
from .errors import RemovalError, RetrievalError, StorageError, UnknownRecordError from .errors import RemovalError, RepositoryError, RetrievalError, StorageError, UnknownRecordError
from .i_file_repository import FileNotFoundError, IFileRepository from .i_file_repository import FileNotFoundError, IFileRepository

View File

@ -1,22 +1,28 @@
class RemovalError(RuntimeError): class RepositoryError(RuntimeError):
"""
Raised when a repository encounters an error while attempting any operation.
"""
class RemovalError(RepositoryError):
""" """
Raised when a repository encounters an error while attempting to remove data. Raised when a repository encounters an error while attempting to remove data.
""" """
class RetrievalError(RuntimeError): class RetrievalError(RepositoryError):
""" """
Raised when a repository encounters an error while attempting to retrieve data. Raised when a repository encounters an error while attempting to retrieve data.
""" """
class StorageError(RuntimeError): class StorageError(RepositoryError):
""" """
Raised when a repository encounters an error while attempting to store data. Raised when a repository encounters an error while attempting to store data.
""" """
class UnknownRecordError(RuntimeError): class UnknownRecordError(RepositoryError):
""" """
Raised when the repository does not contain any data matching the request. Raised when the repository does not contain any data matching the request.
""" """