mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02:00
move error outside of get_email
This commit is contained in:
+8
-2
@@ -150,8 +150,14 @@ def perform_registration(acme, config):
|
||||
return acme.register(messages.NewRegistration.from_data(email=config.email))
|
||||
except messages.Error as e:
|
||||
if e.typ == "urn:acme:error:invalidEmail":
|
||||
config.namespace.email = display_ops.get_email(invalid=True)
|
||||
return perform_registration(acme, config)
|
||||
if config.noninteractive_mode:
|
||||
msg = ("The email you specified was unable to be verified "
|
||||
"by acme. Please ensure it is a valid email and "
|
||||
"attempt registration again.")
|
||||
raise erros.MissingCommandlineFlag(msg)
|
||||
else:
|
||||
config.namespace.email = display_ops.get_email(invalid=True)
|
||||
return perform_registration(acme, config)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
@@ -48,10 +48,7 @@ def get_email(invalid=False, optional=True):
|
||||
invalid_prefix + msg if invalid else msg)
|
||||
except errors.MissingCommandlineFlag:
|
||||
msg = ("You should register before running non-interactively, "
|
||||
"or provide --agree-tos and --email <email_address> flags. "
|
||||
"If you have specified an email with the --email flag, "
|
||||
"please make sure that you entered it correctly and the "
|
||||
"domain is valid.")
|
||||
"or provide --agree-tos and --email <email_address> flags.")
|
||||
raise errors.MissingCommandlineFlag(msg)
|
||||
|
||||
if code != display_util.OK:
|
||||
|
||||
Reference in New Issue
Block a user