Skip to content

Commit 250f0f2

Browse files
Saurus119ZPascal
authored andcommitted
better handling for cp response to catch errors
1 parent a7a7e4b commit 250f0f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

grafana_api/alerting_provisioning.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ def get_contact_point(self, name: str) -> list:
244244
f"{APIEndpoints.ALERTING_PROVISIONING.value}/contact-points?name={name}"
245245
)
246246

247+
if not isinstance(api_call, list):
248+
logging.error(f"Check the error: {api_call}.")
249+
raise Exception
250+
247251
return api_call
248252

249253
def add_contact_point(

0 commit comments

Comments
 (0)