mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 08:12:15 -04:00
Hide tracebacks, but not the ultimate error itself
This commit is contained in:
parent
b6461a1af5
commit
0e3eae153e
1 changed files with 10 additions and 7 deletions
|
|
@ -845,14 +845,17 @@ def _handle_exception(exc_type, exc_value, trace, args):
|
|||
|
||||
if issubclass(exc_type, errors.Error):
|
||||
sys.exit(exc_value)
|
||||
elif args is None:
|
||||
sys.exit(
|
||||
"An unexpected error occurred. Please see the logfile '{0}' "
|
||||
"for more details.".format(logfile))
|
||||
else:
|
||||
sys.exit(
|
||||
"An unexpected error occurred. Please see the logfiles in {0} "
|
||||
"for more details.".format(args.logs_dir))
|
||||
# Tell the user a bit about what happened, without overwhelming
|
||||
# them with a full traceback
|
||||
msg = "An unexpected error occurred.\n"
|
||||
msg += traceback.format_exception_only(exc_type,exc_value)[0]
|
||||
msg += "\nPlease see the "
|
||||
if args is None:
|
||||
msg += "logfile '{0}' for more details.".format(logfile)
|
||||
else:
|
||||
msg += "logfiles in {0} for more details.".format(args.logs_dir)
|
||||
sys.exit(msg)
|
||||
else:
|
||||
sys.exit("".join(
|
||||
traceback.format_exception(exc_type, exc_value, trace)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue