summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-10-02 15:59:41 +0200
committerBrian Coca <bcoca@users.noreply.github.com>2017-10-03 22:48:21 +0200
commit9c6d7ddeb50eb1d0568d6c5b2f286991772b0396 (patch)
tree69ea40a48598e02a93f92fa8df69dbf3fff5aaee
parentwin_reg_stat actually sets properties to be a dictionary, not a list (#31252) (diff)
downloadansible-9c6d7ddeb50eb1d0568d6c5b2f286991772b0396.tar.xz
ansible-9c6d7ddeb50eb1d0568d6c5b2f286991772b0396.zip
report extra info in verbose and if needed
-rwxr-xr-xbin/ansible5
-rw-r--r--lib/ansible/errors/__init__.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/bin/ansible b/bin/ansible
index 7eaa5337b1..5c30b962dc 100755
--- a/bin/ansible
+++ b/bin/ansible
@@ -133,6 +133,11 @@ if __name__ == '__main__':
display.error("Unexpected Exception, this is probably a bug: %s" % to_text(e), wrap_text=False)
if not have_cli_options or have_cli_options and cli.options.verbosity > 2:
log_only = False
+ if hasattr(e, 'orig_exc'):
+ display.vvv('\nexception type: %s' % to_text(type(e.orig_exc)))
+ why = to_text(e.orig_exc)
+ if to_text(e) != why:
+ display.vvv('\noriginal msg: %s' % why)
else:
display.display("to see the full traceback, use -vvv")
log_only = True
diff --git a/lib/ansible/errors/__init__.py b/lib/ansible/errors/__init__.py
index 18119d6d95..3c00d2f33d 100644
--- a/lib/ansible/errors/__init__.py
+++ b/lib/ansible/errors/__init__.py
@@ -67,8 +67,6 @@ class AnsibleError(Exception):
self.message = '%s' % to_native(message)
if orig_exc:
self.orig_exc = orig_exc
- self.message += '\nexception type: %s' % to_native(type(orig_exc))
- self.message += '\nexception: %s' % to_native(orig_exc)
self.tb = ''.join(traceback.format_tb(sys.exc_info()[2]))