Source code for atramhasis.errors

"""
Module containing errors generated by Atramhasis.
"""

from pyramid.httpexceptions import HTTPNotFound


[docs]class SkosRegistryNotFoundException(Exception): """ Atramhasis could not find a SKOS registry. """ def __init__(self, value='No SKOS registry found, please check your application setup'): self.value = value def __str__(self): return repr(self.value)
[docs]class ConceptSchemeNotFoundException(HTTPNotFound): """ A ConceptScheme could not be found. """ def __init__(self, scheme_id): self.value = 'No conceptscheme found with the given id ' + scheme_id def __str__(self): return repr(self.value)
[docs]class LanguageNotFoundException(HTTPNotFound): """ A Language could not be found. """ def __init__(self, scheme_id): self.value = 'No language found with the given id ' + scheme_id def __str__(self): return repr(self.value)
[docs]class ConceptNotFoundException(HTTPNotFound): """ A Concept or Collection could not be found. """ def __init__(self, c_id): self.value = 'No concept found with the given id ' + c_id def __str__(self): return repr(self.value)
[docs]class ValidationError(Exception): """ Some data that was validated is invalid. """ def __init__(self, value, errors): self.value = value self.errors = errors def __str__(self): return repr(self.value)
[docs]class DbNotFoundException(Exception): """ Atramhasis could not find a database. """ def __init__(self, value='No database found, please check your application setup'): self.value = value def __str__(self): return repr(self.value)