]> 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 cd935d032001e65dfa25d08c82d2738f25fc9e59..f9cc3f627a7e88c7f5e8e14fc7d6256461c417ee 100644 (file)
@@ -23,6 +23,10 @@ class DDNSError(Exception):
        pass
 
 
+class DDNSNetworkError(DDNSError):
+       pass
+
+
 class DDNSAbuseError(DDNSError):
        """
                Thrown when the server reports
@@ -56,6 +60,20 @@ 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
@@ -72,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
@@ -80,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