From: Michael Tremer Date: Tue, 23 Jun 2015 22:34:33 +0000 (+0000) Subject: Soft-fail on network errors X-Git-Tag: 008~4 X-Git-Url: http://git.ipfire.org/?p=oddments%2Fddns.git;a=commitdiff_plain;h=29a69850e9e172b5a868e3f2dc0ac63ba08871a8 Soft-fail on network errors When an update could not be performed because of a network error (host unreachable/no route to host) we should not log an error to the database and hold off updates for a long time. Those errors are usually caused by local configuration errors and the servers of the providers should not be bothered with update requests as those won't reach them any way. The client will try to resend the update at the next update call. Signed-off-by: Michael Tremer Signed-off-by: Stefan Schantl --- diff --git a/src/ddns/providers.py b/src/ddns/providers.py index 28b765b..fc1fb82 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -161,6 +161,12 @@ class DDNSProvider(object): try: self.update() + # Catch network errors early, because we do not want to log + # them to the database. They are usually temporary and caused + # by the client side, so that we will retry quickly. + except DDNSNetworkError as e: + raise + # In case of any errors, log the failed request and # raise the exception. except DDNSError as e: