fix: catch only JSON decode errors in error handling

This commit is contained in:
ptrcnull 2024-07-23 14:27:51 +02:00
parent 3004791b38
commit ad07746576

View file

@ -40,7 +40,7 @@ class HetznerHandler(Handler):
res = ex.fp.read().decode('utf-8')
try:
raise Exception(json.loads(res)['error'])
except Exception:
except json.JSONDecodeError:
raise Exception(res)
def create(self, record_name: str, record_value: str) -> None: