comparison libervia/backend/core/exceptions.py @ 4071:4b842c1fb686

refactoring: renamed `sat` package to `libervia.backend`
author Goffi <goffi@goffi.org>
date Fri, 02 Jun 2023 11:49:51 +0200
parents sat/core/exceptions.py@e345d93fb6e5
children 0d7bb4df2343
comparison
equal deleted inserted replaced
4070:d10748475025 4071:4b842c1fb686
1 #!/usr/bin/env python3
2
3
4 # SàT Exceptions
5 # Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org)
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20
21 class ProfileUnknownError(Exception):
22 pass
23
24
25 class ProfileNotInCacheError(Exception):
26 pass
27
28
29 class ProfileNotSetError(Exception):
30 """This error raises when no profile has been set (value @NONE@ is found, but it should have been replaced)"""
31
32
33 class ProfileConnected(Exception):
34 """This error is raised when trying to delete a connected profile."""
35
36
37 class ProfileNotConnected(Exception):
38 pass
39
40
41 class ProfileKeyUnknown(Exception):
42 pass
43
44
45 class ClientTypeError(Exception):
46 """This code is not allowed for this type of client (i.e. component or not)"""
47
48
49 class UnknownEntityError(Exception):
50 pass
51
52
53 class UnknownGroupError(Exception):
54 pass
55
56
57 class MissingModule(Exception):
58 # Used to indicate when a plugin dependence is not found
59 # it's nice to indicate when to find the dependence in argument string
60 pass
61
62
63 class MissingPlugin(Exception):
64 """A SàT plugin needed for a feature/method is missing"""
65 pass
66
67
68 class NotFound(Exception):
69 pass
70
71
72 class ConfigError(Exception):
73 pass
74
75
76 class DataError(Exception):
77 pass
78
79
80 class ExternalRequestError(Exception):
81 """Request to third party server failed"""
82
83
84 class ConflictError(Exception):
85 pass
86
87
88 class TimeOutError(Exception):
89 pass
90
91
92 class CancelError(Exception):
93 pass
94
95
96 class InternalError(Exception):
97 pass
98
99
100 class FeatureNotFound(
101 Exception
102 ): # a disco feature/identity which is needed is not present
103 pass
104
105
106 class BridgeInitError(Exception):
107 pass
108
109
110 class BridgeExceptionNoService(Exception):
111 pass
112
113
114 class DatabaseError(Exception):
115 pass
116
117
118 class PasswordError(Exception):
119 pass
120
121
122 class PermissionError(Exception):
123 pass
124
125
126 class ParsingError(ValueError):
127 pass
128
129
130 class EncryptionError(Exception):
131 """Invalid encryption"""
132 pass
133
134
135 # Something which need to be done is not available yet
136 class NotReady(Exception):
137 pass
138
139
140 class NetworkError(Exception):
141 """Something is wrong with a request (e.g. HTTP(S))"""
142
143
144 class InvalidCertificate(Exception):
145 """A TLS certificate is not valid"""
146 pass
147
148
149 class CommandException(RuntimeError):
150 """An external command failed
151
152 stdout and stderr will be attached to the Exception
153 """
154
155 def __init__(self, msg, stdout, stderr):
156 super(CommandException, self).__init__(msg)
157 self.stdout = stdout
158 self.stderr = stderr