From 060071d5650acc31b2ffe53bd05f1b6861819d71 Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Thu, 1 Jun 2023 19:02:22 +0200 Subject: [PATCH] fix(pingdom-operator): 403 on create --- pingdom-operator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pingdom-operator.py b/pingdom-operator.py index e0677fe..e689f5a 100755 --- a/pingdom-operator.py +++ b/pingdom-operator.py @@ -532,7 +532,13 @@ def create_check(self, ingress, tags: list = None): url = self.api_url('checks') response = self.s.post(url, json=create_request) - response.raise_for_status() + + try: + response.raise_for_status() + except requests.exceptions.HTTPError: + print(response.json()["error"]) + return dict(response.json()) + self.__parse_headers(response.headers) self.__clear_caches()