File: exceptions.py

package info (click to toggle)
python-cvss 3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 107,168 kB
  • sloc: python: 3,230; makefile: 15; sh: 6
file content (138 lines) | stat: -rw-r--r-- 2,156 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Copyright (c) 2016 Red Hat, Inc.
# Author: Stanislav Kontar, Red Hat Product Security
# License: LGPLv3+

"""
All exceptions needed by CVSS library.
"""


class CVSSError(Exception):
    """
    General CVSS exception.
    """

    pass


class CVSS2Error(CVSSError):
    """
    General CVSS2 exception.
    """

    pass


class CVSS2MalformedError(CVSS2Error):
    """
    Exception for malformed input CVSS2 vectors.
    """

    pass


class CVSS2MandatoryError(CVSS2Error):
    """
    Exception for missing mandatory fields.
    """

    pass


class CVSS2RHScoreDoesNotMatch(CVSS2Error):
    """
    Exception when parsing CVSS2 vectors in Red Hat notation, which have score not matching the
    computed score.
    """

    pass


class CVSS2RHMalformedError(CVSS2Error):
    """
    Exception for malformed input CVSS2 vectors in Red Hat notation.
    """

    pass


class CVSS3Error(CVSSError):
    """
    General CVSS3 exception.
    """

    pass


class CVSS3MalformedError(CVSS3Error):
    """
    Exception for malformed input CVSS3 vectors.
    """

    pass


class CVSS3MandatoryError(CVSS3Error):
    """
    Exception for missing mandatory fields.
    """

    pass


class CVSS3RHScoreDoesNotMatch(CVSS3Error):
    """
    Exception when parsing CVSS3 vectors in Red Hat notation, which have score not matching the
    computed score.
    """

    pass


class CVSS3RHMalformedError(CVSS3Error):
    """
    Exception for malformed input CVSS3 vectors in Red Hat notation.
    """

    pass


class CVSS4Error(CVSSError):
    """
    General CVSS4 exception.
    """

    pass


class CVSS4MalformedError(CVSS4Error):
    """
    Exception for malformed input CVSS4 vectors.
    """

    pass


class CVSS4MandatoryError(CVSS4Error):
    """
    Exception for missing mandatory fields.
    """

    pass


class CVSS4RHScoreDoesNotMatch(CVSS4Error):
    """
    Exception when parsing CVSS4 vectors in Red Hat notation, which have score not matching the
    computed score.
    """

    pass


class CVSS4RHMalformedError(CVSS4Error):
    """
    Exception for malformed input CVSS4 vectors in Red Hat notation.
    """

    pass