SkosRegistryNotFoundException.__str__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
"""
2
Module containing errors generated by Atramhasis.
3
"""
4
5
from pyramid.httpexceptions import HTTPNotFound
6
7
8
class SkosRegistryNotFoundException(Exception):
9
    """
10
    Atramhasis could not find a SKOS registry.
11
    """
12
13
    def __init__(
14
        self, value="No SKOS registry found, please check your application setup"
15
    ):
16
        self.value = value
17
18
    def __str__(self):
19
        return repr(self.value)
20
21
22
class ConceptSchemeNotFoundException(HTTPNotFound):
23
    """
24
    A ConceptScheme could not be found.
25
    """
26
27
    def __init__(self, scheme_id):
28
        self.value = "No conceptscheme found with the given id " + scheme_id
29
        super().__init__(detail=self.value)
30
31
    def __str__(self):
32
        return repr(self.value)
33
34
35
class LanguageNotFoundException(HTTPNotFound):
36
    """
37
    A Language could not be found.
38
    """
39
40
    def __init__(self, scheme_id):
41
        self.value = "No language found with the given id " + scheme_id
42
        super().__init__(detail=self.value)
43
44
    def __str__(self):
45
        return repr(self.value)
46
47
48
class ConceptNotFoundException(HTTPNotFound):
49
    """
50
    A Concept or Collection could not be found.
51
    """
52
53
    def __init__(self, c_id):
54
        self.value = "No concept found with the given id " + c_id
55
        super().__init__(detail=self.value)
56
57
    def __str__(self):
58
        return repr(self.value)
59
60
61
class ValidationError(Exception):
62
    """
63
    Some data that was validated is invalid.
64
    """
65
66
    def __init__(self, value, errors):
67
        self.value = value
68
        self.errors = errors
69
70
    def __str__(self):
71
        return repr(self.value)
72
73
74
class DbNotFoundException(Exception):
75
    """
76
    Atramhasis could not find a database.
77
    """
78
79
    def __init__(self, value="No database found, please check your application setup"):
80
        self.value = value
81
82
    def __str__(self):
83
        return repr(self.value)
84
85
86
class SQLAlchemyProviderNotFoundException(HTTPNotFound):
87
    """
88
    SQLAlchemyProvider could not be found in the database.
89
    """
90
91
    def __init__(self, p_id):
92
        self.value = "No SQLAlchemyProvider found with the given id " + p_id
93
94
    def __str__(self):
95
        return repr(self.value)
96