Skip to content

Commit

Permalink
Merge branch 'main' into feat-1770-add-time-frame
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh-jonnalagadda authored Sep 24, 2024
2 parents 96bd237 + da3398c commit 74dec1c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion keep/providers/zabbix_provider/zabbix_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,26 @@ def __send_request(self, method: str, params: dict = None):

response = requests.post(url, json=data, headers=headers)

response.raise_for_status()
try:
response.raise_for_status()
except requests.HTTPError:
self.logger.exception(
"Error while sending request to Zabbix API",
extra={
"response": response.text,
"tenant_id": self.context_manager.tenant_id,
},
)
raise
response_json = response.json()
if "error" in response_json:
self.logger.error(
"Error while querying zabbix",
extra={
"tenant_id": self.context_manager.tenant_id,
"response_json": response_json,
},
)
raise ProviderMethodException(response_json.get("error", {}).get("data"))
return response_json

Expand Down

0 comments on commit 74dec1c

Please sign in to comment.