Commit faed1b2d by Brian Coca

better error reporting when doc parsing fails

parent b27d7620
......@@ -81,6 +81,7 @@ class DocCLI(CLI):
text = ''
for module in self.args:
try:
filename = module_loader.find_plugin(module)
if filename is None:
self.display.warning("module %s not found in %s\n" % (module, DocCLI.print_paths(module_loader)))
......@@ -117,7 +118,9 @@ class DocCLI(CLI):
else:
# this typically means we couldn't even parse the docstring, not just that the YAML is busted,
# probably a quoting issue.
self.display.warning("module %s missing documentation (or could not parse documentation)\n" % module)
raise AnsibleError("Parsing produced an empty object.")
except Exception, e:
raise AnsibleError("module %s missing documentation (or could not parse documentation): %s\n" % (module, str(e)))
CLI.pager(text)
return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment