Skip to content

Commit

Permalink
Added more descriptive error message
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Cervenka <[email protected]>
  • Loading branch information
Hadatko committed Nov 8, 2024
1 parent d38d2ac commit 839da4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
*.egg-info
dist
7 changes: 4 additions & 3 deletions certbot_dns_wedos/dns_wedos.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import hashlib, pytz, re
from datetime import datetime
from datetime import datetime

import requests, json
from typing import Any, Callable, Optional

import logging
import logging
from certbot import errors
from certbot.plugins.dns_common import CredentialsConfiguration, DNSAuthenticator

Expand Down Expand Up @@ -58,6 +58,7 @@ def _handlerResponse(self, response: requests.post) -> dict:
if response['response']['code'] >= 2000:
raise errors.PluginError('Error code received from Wedos API, The error '
f'code is {response["response"]["code"]}, '
f'details {response["response"]}'
f'you can find what the code mean here: {WEDOS_CODE}')
return response

Expand Down Expand Up @@ -133,7 +134,7 @@ def _validate_credentials(self, credentials: CredentialsConfiguration) -> None:
if not auth:
raise errors.PluginError('Missing parameter AUTH (password) for the Wedos API.'
' [dns_wedos_auth=ExamplePassword]')
if propagation_seconds < 300:
if propagation_seconds < 300:
raise errors.PluginError('Propagation seconds cannot be lower than 300 seconds.'
' (Recommended propagation time is 420 seconds)')
if '@' not in user:
Expand Down

0 comments on commit 839da4b

Please sign in to comment.