certbot-dns-ionos icon indicating copy to clipboard operation
certbot-dns-ionos copied to clipboard

Exception while handling ionos API error

Open JulienPalard opened this issue 10 months ago • 0 comments

In dns_ionos.py line 125 there's:

        if resp.status_code != 200:
            content = json.loads(resp.content)[0] # on error content is array with 1 element                                                       

But I got a IONOS API answer with no array, just a message, like this:

{"message":"Missing or invalid API key."}

Maybe just using error_msg = resp.reason + " " + resp.text would be more robust? I won't care reading a bit of json in my logs :D

JulienPalard avatar Apr 04 '24 13:04 JulienPalard