]> git.ipfire.org Git - oddments/ddns.git/commitdiff
Catch 'Internal Server Error' on update
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Jul 2015 10:25:17 +0000 (12:25 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 9 Jul 2015 19:22:32 +0000 (21:22 +0200)
When there is an internal server error, we won't log an error
and hold off updates for a while. This is an error on the
provider's side and the client must retry in order to update
the hostname.

This error was seen with selfhost.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/ddns/providers.py

index fc1fb82cb6ac63b7feb7e96ac5d6a013b0787fe3..9eaaa6ce5dd7d4072c91a2f47a869dce3e184389 100644 (file)
@@ -161,10 +161,13 @@ class DDNSProvider(object):
                try:
                        self.update()
 
-               # Catch network errors early, because we do not want to log
+               # 1) 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:
+               # 2) If there is an internet server error (HTTP code 500) on the
+               # provider's site, we will not log a failure and try again
+               # shortly.
+               except (DDNSNetworkError, DDNSInternalServerError):
                        raise
 
                # In case of any errors, log the failed request and