From: Michael Tremer Date: Sat, 4 Jul 2015 10:25:17 +0000 (+0200) Subject: Catch 'Internal Server Error' on update X-Git-Tag: 008~3 X-Git-Url: http://git.ipfire.org/?p=oddments%2Fddns.git;a=commitdiff_plain;h=2e09c70d3309e53b48fe4df0c95b9d77731d2ac0 Catch 'Internal Server Error' on update 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 Signed-off-by: Stefan Schantl --- diff --git a/src/ddns/providers.py b/src/ddns/providers.py index fc1fb82..9eaaa6c 100644 --- a/src/ddns/providers.py +++ b/src/ddns/providers.py @@ -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