catch all 4xx error codes with POST
This commit is contained in:
parent
5f0eb2bc4c
commit
e8b8de7ca0
3
push.py
3
push.py
|
@ -136,7 +136,8 @@ def alkira_post(session, uri, body):
|
|||
url = f'{ALKIRA_BASE_URI}{uri}'
|
||||
try:
|
||||
response = session.post(url, data=json.dumps(body), headers=headers)
|
||||
if response.status_code == 400:
|
||||
match int(str(response.status_code)[0]):
|
||||
case 4:
|
||||
logging.error(response.content)
|
||||
response.raise_for_status()
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in New Issue