Request exception handling

This commit is contained in:
VakarisZ 2019-05-27 09:49:40 +03:00
parent fe236ebc05
commit f4a47f3cb3
1 changed files with 8 additions and 4 deletions

View File

@ -41,10 +41,14 @@ class UsersPBA(PBA):
:return: True if successful, false otherwise :return: True if successful, false otherwise
""" """
pba_file_contents = requests.get("https://%s/api/pba/download/%s" % try:
(WormConfiguration.current_server, filename), pba_file_contents = requests.get("https://%s/api/pba/download/%s" %
verify=False, (WormConfiguration.current_server, filename),
proxies=ControlClient.proxies) verify=False,
proxies=ControlClient.proxies)
except requests.exceptions.RequestException:
return False
if not pba_file_contents.content: if not pba_file_contents.content:
LOG.error("Island didn't respond with post breach file.") LOG.error("Island didn't respond with post breach file.")
return False return False