Source code for journal_manager.core.exceptions

"""
Exceptions raised by journal-manager api.
"""

from pathlib import Path
from typing import Optional, Iterable, Union


[docs]class ConfigurationFileDoesNotExist(BaseException): pass
[docs]class ConfigurationFolderDoesNotExist(BaseException): pass
[docs]class EmptyList(BaseException): pass
[docs]class InvalidName(Exception): def __init__(self, names: Iterable[str] = []): self.names = names
[docs]class InvalidLocation(Exception): def __init__(self, locations: Union[Iterable[Path], Path] = []): self.locations = locations def __iter__(self): if isinstance(self.locations, Path): yield self.locations else: return self.locations.__iter__()
[docs]class InvalidIncludeAllFolder(Exception): def __init__(self, path: Optional[str] = None): self.path = path
[docs]class InvalidTemplate(Exception): def __init__(self, msg: Optional[str] = None): self.msg = msg
[docs]class InvalidAttribute(Exception): def __init__(self, msg: Optional[str] = None): self.msg = msg