diff --git a/hacking/module_formatter.py b/hacking/module_formatter.py index 00c9f57790..e18aa8a837 100755 --- a/hacking/module_formatter.py +++ b/hacking/module_formatter.py @@ -308,7 +308,11 @@ def process_module(module, options, env, template, outputname, module_map, alias doc['ansible_version'] = options.ansible_version doc['plainexamples'] = examples #plain text if returndocs: - doc['returndocs'] = yaml.safe_load(returndocs) + try: + doc['returndocs'] = yaml.safe_load(returndocs) + except: + print("could not load yaml: %s" % returndocs) + raise else: doc['returndocs'] = None