mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 00:02:14 -04:00
LetsEncryptClientError
This commit is contained in:
parent
d2f4644b4f
commit
cdde731aa4
3 changed files with 9 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ from letsencrypt.client import apache_configurator
|
|||
from letsencrypt.client import CONFIG
|
||||
from letsencrypt.client import crypto_util
|
||||
from letsencrypt.client import display
|
||||
from letsencrypt.client import errors
|
||||
from letsencrypt.client import le_util
|
||||
from letsencrypt.client import logger
|
||||
|
||||
|
|
@ -328,7 +329,7 @@ class Client(object):
|
|||
(msg_dict["error"],
|
||||
msg_dict.get("message", ""),
|
||||
msg_dict.get("moreInfo", "")))
|
||||
raise Exception(msg_dict["error"])
|
||||
raise errors.LetsEncryptClientError(msg_dict["error"])
|
||||
|
||||
elif msg_dict["type"] == "defer":
|
||||
logger.info("Waiting for %d seconds..." % delay)
|
||||
|
|
|
|||
5
letsencrypt/client/errors.py
Normal file
5
letsencrypt/client/errors.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
"""Let's Encrypt client errors."""
|
||||
|
||||
|
||||
class LetsEncryptClientError(Exception):
|
||||
"""Generic Let's Encrypt client error."""
|
||||
|
|
@ -5,6 +5,7 @@ import time
|
|||
import dialog
|
||||
|
||||
from letsencrypt.client import display
|
||||
from letsencrypt.client import errors
|
||||
|
||||
|
||||
class Singleton(object):
|
||||
|
|
@ -35,7 +36,7 @@ class Logger(Singleton):
|
|||
return self.debugLevelStr[level]
|
||||
|
||||
def log(self, level, data):
|
||||
raise Exception("Error: no Logger defined")
|
||||
raise errors.LetsEncryptClientError("No Logger defined")
|
||||
|
||||
def timefmt(self, t=None):
|
||||
if t == None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue