]> git.ipfire.org Git - people/ms/pakfire.git/blob - python/pakfire/errors.py
transport: Catch 503 Bad Gateway HTTP errors.
[people/ms/pakfire.git] / python / pakfire / errors.py
1 #!/usr/bin/python
2 ###############################################################################
3 # #
4 # Pakfire - The IPFire package management system #
5 # Copyright (C) 2011 Pakfire development team #
6 # #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU 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 General Public License for more details. #
16 # #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 ###############################################################################
21
22 from i18n import _
23
24 class commandTimeoutExpired(Exception):
25 pass # XXX cannot be as is
26
27 class Error(Exception):
28 exit_code = 1
29
30 message = _("An unhandled error occured.")
31
32
33 class ActionError(Error):
34 pass
35
36 class BuildAbortedException(Error):
37 pass
38
39 class BuildError(Error):
40 pass
41
42 class BuildRootLocked(Error):
43 pass
44
45 class CompressionError(Error):
46 message = _("Could not compress/decompress data.")
47
48
49 class ConfigError(Error):
50 pass
51
52 class DatabaseError(Error):
53 pass
54
55 class DependencyError(Error):
56 exit_code = 4
57
58 message = _("One or more dependencies could not been resolved.")
59
60 class DownloadError(Error):
61 message = _("An error occured when pakfire tried to download files.")
62
63
64 class FileError(Error):
65 pass
66
67 class FileNotFoundError(Error):
68 pass
69
70 class NotAnIPFireSystemError(Error):
71 pass
72
73 class OfflineModeError(Error):
74 message = _("The requested action cannot be done on offline mode.\n"
75 "Please connect your system to the network, remove --offline from the"
76 " command line and try again.")
77
78 class PackageFormatUnsupportedError(Error):
79 pass
80
81 class PakfireError(Error):
82 pass
83
84
85 class PakfireContainerError(Error):
86 message = _("Running pakfire-build in a pakfire container?")
87
88
89 class ShellEnvironmentError(Error):
90 pass
91
92
93 class SignatureError(Error):
94 pass
95
96
97 class TransactionCheckError(Error):
98 message = _("Transaction test was not successful")
99
100
101 class TransportError(Error):
102 pass
103
104
105 class TransportBadGatewayError(TransportError):
106 pass
107
108
109 class TransportConnectionError(TransportError):
110 pass
111
112
113 class TransportConnectionDNSError(TransportConnectionError):
114 pass
115
116
117 class TransportConnectionProxyError(TransportConnectionError):
118 pass
119
120
121 class TransportConnectionReadError(TransportConnectionError):
122 pass
123
124
125 class TransportConnectionResetError(TransportConnectionError):
126 pass
127
128
129 class TransportConnectionTimeoutError(TransportConnectionError):
130 pass
131
132
133 class TransportConnectionWriteError(TransportConnectionError):
134 pass
135
136
137 class TransportSSLError(TransportConnectionError):
138 pass
139
140
141 class TransportSSLCertificateExpiredError(TransportSSLError):
142 pass
143
144
145 class TransportInternalServerError(TransportError):
146 pass
147
148
149 class TransportForbiddenError(TransportError):
150 pass
151
152
153 class TransportMaxTriesExceededError(TransportError):
154 pass
155
156
157 class TransportNotFoundError(TransportError):
158 pass
159
160
161 class XMLRPCError(Error):
162 message = _("Generic XMLRPC error.")
163
164
165 class XMLRPCForbiddenError(XMLRPCError):
166 message = _("You are forbidden to perform this action. Maybe you need to check your credentials.")
167
168
169 class XMLRPCInternalServerError(XMLRPCError):
170 message = _("A request could not be fulfilled by the server.")
171
172
173 class XMLRPCNotFoundError(XMLRPCError):
174 message = _("Could not find the requested URL.")
175
176
177 class XMLRPCTransportError(XMLRPCError):
178 message = _("An unforseable problem on the XML-RPC transport connection occured.")