]> git.ipfire.org Git - oddments/ddns.git/blobdiff - src/ddns/errors.py
Catch various network/server errors.
[oddments/ddns.git] / src / ddns / errors.py
index 1803c98e197c8da92af6f9c6f9e9ae8ffc29080b..f9cc3f627a7e88c7f5e8e14fc7d6256461c417ee 100644 (file)
@@ -23,6 +23,10 @@ class DDNSError(Exception):
        pass
 
 
+class DDNSNetworkError(DDNSError):
+       pass
+
+
 class DDNSAbuseError(DDNSError):
        """
                Thrown when the server reports
@@ -39,6 +43,15 @@ class DDNSAuthenticationError(DDNSError):
        pass
 
 
+class DDNSBlockedError(DDNSError):
+       """
+               Thrown when the dynamic update client
+               (specified by the user-agent) has been blocked
+               by a dynamic DNS provider.
+       """
+       pass
+
+
 class DDNSConfigurationError(DDNSError):
        """
                Thrown when invalid or insufficient
@@ -47,6 +60,28 @@ class DDNSConfigurationError(DDNSError):
        pass
 
 
+class DDNSConnectionRefusedError(DDNSNetworkError):
+       """
+               Thrown when a connection is refused.
+       """
+       pass
+
+
+class DDNSConnectionTimeoutError(DDNSNetworkError):
+       """
+               Thrown when a connection to a server has timed out.
+       """
+       pass
+
+
+class DDNSHostNotFoundError(DDNSError):
+       """
+               Thrown when a configuration entry could
+               not be found.
+       """
+       pass
+
+
 class DDNSInternalServerError(DDNSError):
        """
                Thrown when the remote server reported
@@ -55,6 +90,13 @@ class DDNSInternalServerError(DDNSError):
        pass
 
 
+class DDNSNetworkUnreachableError(DDNSNetworkError):
+       """
+               Thrown when a network is not reachable.
+       """
+       pass
+
+
 class DDNSRequestError(DDNSError):
        """
                Thrown when a request could
@@ -63,6 +105,13 @@ class DDNSRequestError(DDNSError):
        pass
 
 
+class DDNSServiceUnavailableError(DDNSNetworkError):
+       """
+               Equivalent to HTTP error code 503.
+       """
+       pass
+
+
 class DDNSUpdateError(DDNSError):
        """
                Thrown when an update could not be