tweak logger responses in helper
This commit is contained in:
parent
1252c1af8d
commit
176be580b7
1 changed files with 4 additions and 4 deletions
|
@ -80,21 +80,21 @@ def connection_handler(session, request, verify):
|
||||||
try:
|
try:
|
||||||
get = s.send(r, verify=v)
|
get = s.send(r, verify=v)
|
||||||
if get.status_code == 401:
|
if get.status_code == 401:
|
||||||
logger.info('Your api key is incorrect for {}'.format(r.url))
|
logger.info('Your api key is incorrect for %s', r.url)
|
||||||
elif get.status_code == 404:
|
elif get.status_code == 404:
|
||||||
logger.info('This url doesnt even resolve: {}'.format(r.url))
|
logger.info('This url doesnt even resolve: %s', r.url)
|
||||||
elif get.status_code == 200:
|
elif get.status_code == 200:
|
||||||
try:
|
try:
|
||||||
return_json = get.json()
|
return_json = get.json()
|
||||||
except JSONDecodeError:
|
except JSONDecodeError:
|
||||||
logger.error('No JSON response... BORKED! Let us know in discord')
|
logger.error('No JSON response. Response is: %s', get.text)
|
||||||
# 204 No Content is for ASA only
|
# 204 No Content is for ASA only
|
||||||
elif get.status_code == 204:
|
elif get.status_code == 204:
|
||||||
if get.headers['X-Auth-Token']:
|
if get.headers['X-Auth-Token']:
|
||||||
return get.headers['X-Auth-Token']
|
return get.headers['X-Auth-Token']
|
||||||
|
|
||||||
except InvalidSchema:
|
except InvalidSchema:
|
||||||
logger.error('You added http(s):// in the config file. Don\'t do that.')
|
logger.error("You added http(s):// in the config file. Don't do that.")
|
||||||
|
|
||||||
except SSLError as e:
|
except SSLError as e:
|
||||||
logger.error('Either your host is unreachable or you have an SSL issue. : %s', e)
|
logger.error('Either your host is unreachable or you have an SSL issue. : %s', e)
|
||||||
|
|
Loading…
Reference in a new issue