diff --git a/nyacme/handlers/cloudflare.py b/nyacme/handlers/cloudflare.py index 0f0fd18..ff57024 100644 --- a/nyacme/handlers/cloudflare.py +++ b/nyacme/handlers/cloudflare.py @@ -23,7 +23,11 @@ class CloudflareHandler(Handler): env = os.environ.copy() env['CF_API_TOKEN'] = self.secret res = subprocess.run(['flarectl', '--json'] + args, check=True, stdout=subprocess.PIPE, env=env) - return json.loads(res.stdout) + try: + return json.loads(res.stdout) + except json.decoder.JSONDecodeError as ex: + self.log.warning('could not decode as JSON: %s', res.stdout) + raise ex def create(self, record_name: str, record_value: str) -> None: full_record_name = record_name + '.' + self.zone