Displaying DialogError details correctly

This commit is contained in:
Amjad Mashaal 2016-05-25 20:34:38 +02:00
parent 686e60b4bf
commit 12a356298c

View file

@ -623,7 +623,11 @@ def _handle_exception(exc_type, exc_value, trace, config):
# Here we're passing a client or ACME error out to the client at the shell
# Tell the user a bit about what happened, without overwhelming
# them with a full traceback
err = traceback.format_exception_only(exc_type, exc_value)[0]
from dialog import DialogError
if issubclass(exc_type, DialogError):
err = exc_value.complete_message()
else:
err = traceback.format_exception_only(exc_type, exc_value)[0]
# Typical error from the ACME module:
# acme.messages.Error: urn:acme:error:malformed :: The request message was
# malformed :: Error creating new registration :: Validation of contact