From d230dcafebf1ade14bc5f9bf5954282df42fca71 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 18 May 2020 09:31:15 -0700 Subject: [PATCH] Print cause of exit in red text. --- certbot/certbot/_internal/log.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/certbot/certbot/_internal/log.py b/certbot/certbot/_internal/log.py index 0a492ba55..21996548d 100644 --- a/certbot/certbot/_internal/log.py +++ b/certbot/certbot/_internal/log.py @@ -323,7 +323,10 @@ def post_arg_parse_except_hook(exc_type, exc_value, trace, debug, log_path): else: logger.debug('Exiting abnormally:', exc_info=exc_info) if issubclass(exc_type, errors.Error): - sys.exit(exc_value) + # Use logger to print the error message to take advantage of + # our logger printing warnings and errors in red text. + logger.error(exc_value) + sys.exit(1) logger.error('An unexpected error occurred:') if messages.is_acme_error(exc_value): # Remove the ACME error prefix from the exception