When there is no route to a target host, we will throw
a DDNSNetworkError so that this error can be handled afterwards.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
reason = N_("Network unreachable")
reason = N_("Network unreachable")
+class DDNSNoRouteToHostError(DDNSNetworkError):
+ """
+ Thrown when there is no route to a host.
+ """
+ reason = N_("No route to host")
+
+
class DDNSNotFound(DDNSError):
"""
Thrown when the called URL has not been found
class DDNSNotFound(DDNSError):
"""
Thrown when the called URL has not been found
elif e.reason.errno == 111:
raise DDNSConnectionRefusedError
elif e.reason.errno == 111:
raise DDNSConnectionRefusedError
+ # No route to host
+ elif e.reason.errno == 113:
+ raise DDNSNoRouteToHostError(req.host)
+
# Raise all other unhandled exceptions.
raise
# Raise all other unhandled exceptions.
raise