]>
git.ipfire.org Git - oddments/ddns.git/blob - src/ddns/errors.py
2 ###############################################################################
4 # ddns - A dynamic DNS client for IPFire #
5 # Copyright (C) 2012 IPFire development team #
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. #
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. #
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/>. #
20 ###############################################################################
24 class DDNSError(Exception):
26 Generic error class for all exceptions
31 def __init__(self
, message
=None):
32 self
.message
= message
35 class DDNSNetworkError(DDNSError
):
37 Thrown when a network error occured.
39 reason
= N_("Network error")
42 class DDNSAbuseError(DDNSError
):
44 Thrown when the server reports
45 abuse for this account.
47 reason
= N_("The server denied processing the request because account abuse is suspected")
50 class DDNSAuthenticationError(DDNSError
):
52 Thrown when the server did not
53 accept the user credentials.
55 reason
= N_("Authentication against the server has failed")
58 class DDNSBlockedError(DDNSError
):
60 Thrown when the dynamic update client
61 (specified by the user-agent) has been blocked
62 by a dynamic DNS provider.
64 reason
= N_("The server denies any updates from this client")
67 class DDNSConfigurationError(DDNSError
):
69 Thrown when invalid or insufficient
70 data is provided by the configuration file.
72 reason
= N_("The configuration file has errors")
75 class DDNSConnectionRefusedError(DDNSNetworkError
):
77 Thrown when a connection is refused.
79 reason
= N_("Connection refused")
82 class DDNSConnectionTimeoutError(DDNSNetworkError
):
84 Thrown when a connection to a server has timed out.
86 reason
= N_("Connection timeout")
89 class DDNSHostNotFoundError(DDNSError
):
91 Thrown when a configuration entry could
94 reason
= N_("The host could not be found in the configuration file")
97 class DDNSInternalServerError(DDNSError
):
99 Thrown when the remote server reported
100 an error on the provider site.
102 reason
= N_("Internal server error")
105 class DDNSNetworkUnreachableError(DDNSNetworkError
):
107 Thrown when a network is not reachable.
109 reason
= N_("Network unreachable")
112 class DDNSNoRouteToHostError(DDNSNetworkError
):
114 Thrown when there is no route to a host.
116 reason
= N_("No route to host")
119 class DDNSNotFound(DDNSError
):
121 Thrown when the called URL has not been found
123 reason
= N_("Not found")
126 class DDNSRequestError(DDNSError
):
128 Thrown when a request could
129 not be properly performed.
131 reason
= N_("Request error")
134 class DDNSResolveError(DDNSNetworkError
):
136 Thrown when a DNS record could not be resolved
137 because of a local error.
139 reason
= N_("Could not resolve DNS entry")
142 class DDNSServiceUnavailableError(DDNSNetworkError
):
144 Equivalent to HTTP error code 503.
146 reason
= N_("Service unavailable")
149 class DDNSUpdateError(DDNSError
):
151 Thrown when an update could not be
154 reason
= N_("The update could not be performed")