From e3be044d5d20406370d09dfb6047f500ba94b9e5 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 8 Jun 2015 20:32:46 +0100 Subject: [PATCH] Improve network exception handling, again. --- openlp/core/utils/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 6516ddc85..974db7b06 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -24,6 +24,7 @@ The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP. """ from datetime import datetime from distutils.version import LooseVersion +from http.client import HTTPException import logging import locale import os @@ -430,6 +431,11 @@ def get_web_page(url, header=None, update_openlp=False): page = None if retries > CONNECTION_RETRIES: raise + except HTTPException: + log.exception('HTTPException error: {}'.format(url)) + page = None + if retries > CONNECTION_RETRIES: + raise except: # Don't know what's happening, so reraise the original raise