from typing import TYPE_CHECKING
if TYPE_CHECKING:
from onegov.directory.models import DirectoryEntry
from wtforms.form import _FormErrors
[docs]
class OnegovDirectoryError(Exception):
pass
[docs]
class ValidationError(OnegovDirectoryError):
def __init__(
self,
entry: 'DirectoryEntry',
errors: '_FormErrors',
*args: object
) -> None:
super().__init__(*args)
[docs]
self.entry = entry
[docs]
class MissingColumnError(OnegovDirectoryError):
def __init__(self, column: str, *args: object) -> None:
super().__init__(*args)
[docs]
class DuplicateEntryError(OnegovDirectoryError):
def __init__(self, name: str, *args: object) -> None:
super().__init__(*args)
[docs]
class MissingFileError(OnegovDirectoryError):
def __init__(self, name: str, *args: object) -> None:
super().__init__(*args)