public inbox for ddns@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] Catch 'Internal Server Error' on update
@ 2015-07-04 10:25 Michael Tremer
  0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2015-07-04 10:25 UTC (permalink / raw)
  To: ddns

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

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(a)ipfire.org>
---
 src/ddns/providers.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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
-- 
2.4.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-04 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-04 10:25 [PATCH] Catch 'Internal Server Error' on update Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox