This commit is contained in:
+10
-4
@@ -187,10 +187,16 @@ class Server:
|
||||
url, headers=headers, json=new_item, timeout=self.timeout
|
||||
)
|
||||
log.info(f"Status: {create.status_code}")
|
||||
if create.status_code == 404:
|
||||
raise EndPointNotAvailableException
|
||||
if create.status_code == 409:
|
||||
log.fatal("Create Exception %s", create.json())
|
||||
match create.status_code:
|
||||
case 404:
|
||||
log.info("Endpoint %s not available", url)
|
||||
raise EndPointNotAvailableException
|
||||
case 405:
|
||||
log.info("POST request %s returned 405", url)
|
||||
case 409:
|
||||
log.fatal("Create Exception %s", create.json())
|
||||
case _:
|
||||
log.info("")
|
||||
data = create.json()
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user