Improve network exception handling, again.

This commit is contained in:
Tomas Groth 2015-06-08 20:32:46 +01:00
parent 7eb506fae8
commit e3be044d5d
1 changed files with 6 additions and 0 deletions

View File

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