mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
Prevent misleading messages about whitelisting
This commit is contained in:
@@ -30,8 +30,11 @@ def request_response(url, method="get", auto_raise=True, whitelist_status_code=N
|
|||||||
# is white listed.
|
# is white listed.
|
||||||
if whitelist_status_code and auto_raise:
|
if whitelist_status_code and auto_raise:
|
||||||
if response.status_code not in whitelist_status_code:
|
if response.status_code not in whitelist_status_code:
|
||||||
logger.debug("Response status code %d is not white listed, raising exception", response.status_code)
|
try:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
except:
|
||||||
|
logger.debug("Response status code %d is not white listed, raised exception", response.status_code)
|
||||||
|
raise
|
||||||
elif auto_raise:
|
elif auto_raise:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user