Respose code check
This commit is contained in:
@@ -47,7 +47,8 @@ class SimbrellaIntegration:
|
|||||||
response = requests.post(url, json=payload, timeout=10, headers=headers)
|
response = requests.post(url, json=payload, timeout=10, headers=headers)
|
||||||
logger.error(f"This is Response: {str(response)}", exc_info=True)
|
logger.error(f"This is Response: {str(response)}", exc_info=True)
|
||||||
# Raise an error for non-200 responses
|
# Raise an error for non-200 responses
|
||||||
response.raise_for_status()
|
if response.status_code != 200:
|
||||||
|
response.raise_for_status()
|
||||||
|
|
||||||
return response.json()
|
return response.json()
|
||||||
except requests.exceptions.RequestException as err:
|
except requests.exceptions.RequestException as err:
|
||||||
|
|||||||
Reference in New Issue
Block a user