From b64d4efa3bce40d12e4c500e11acff4deac31530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 29 Nov 2013 19:13:41 +0100 Subject: [PATCH] do not abort on server error --- themis/importexport/sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themis/importexport/sync.py b/themis/importexport/sync.py index 8a70a6d..5e0cb8d 100644 --- a/themis/importexport/sync.py +++ b/themis/importexport/sync.py @@ -207,7 +207,11 @@ class SyncFromThemis(UtilityView): for count, document_url in enumerate(documents): log.info('loading %s' % document_url) - data = json.load(self.urlopen('%s/json' % document_url)) + try: + data = json.load(self.urlopen('%s/json' % document_url)) + except urllib2.HTTPError as e: + logging.info('failed to load (%r)' % e) + continue new_id = data.get('id') is_question = False