Catch and raise bad status 400

When the request is malformed. Added logging to hopefully get to the
bottom of a bug pulling albums from server.
This commit is contained in:
angelblue05 2016-10-04 01:14:14 -05:00
commit e58d98bc10
2 changed files with 13 additions and 3 deletions

View file

@ -248,6 +248,7 @@ class DownloadUtils(object):
##### THE RESPONSE #####
log.debug(kwargs)
response = self._requests(action_type, session, **kwargs)
#response = requests.get('http://httpbin.org/status/400')
if response.status_code == 204:
# No body in the response
@ -287,6 +288,10 @@ class DownloadUtils(object):
except requests.exceptions.HTTPError as error:
if response.status_code == 400:
log.error("Malformed request: %s", error)
raise Warning('400')
if response.status_code == 401:
# Unauthorized
status = window('emby_serverStatus')