Skip to content

Commit

Permalink
Merge pull request #6 from Hadatko/feature/response
Browse files Browse the repository at this point in the history
Added more descriptive error message + Lint
  • Loading branch information
clazzor authored Nov 18, 2024
2 parents d38d2ac + 839da4b commit 3720ac2
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 3720ac2

Please sign in to comment.