forked from openlp/openlp
Improve network exception handling.
This commit is contained in:
parent
14031720be
commit
7eb506fae8
@ -414,6 +414,11 @@ def get_web_page(url, header=None, update_openlp=False):
|
||||
page = None
|
||||
if retries > CONNECTION_RETRIES:
|
||||
raise
|
||||
except socket.gaierror:
|
||||
log.exception('Socket gaierror: {}'.format(url))
|
||||
page = None
|
||||
if retries > CONNECTION_RETRIES:
|
||||
raise
|
||||
except ConnectionRefusedError:
|
||||
log.exception('ConnectionRefused: {}'.format(url))
|
||||
page = None
|
||||
|
@ -748,7 +748,10 @@ def get_soup_for_bible_ref(reference_url, header=None, pre_parse_regex=None, pre
|
||||
"""
|
||||
if not reference_url:
|
||||
return None
|
||||
try:
|
||||
page = get_web_page(reference_url, header, True)
|
||||
except:
|
||||
page = None
|
||||
if not page:
|
||||
send_error_message('download')
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user