summaryrefslogtreecommitdiffstats
path: root/bin/puppetdoc
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-13 08:56:06 -0600
committerLuke Kanies <luke@madstop.com>2008-02-13 08:56:06 -0600
commit068b61e022c42fb12a5c657cb9d1ebbd98c7ca38 (patch)
tree37d7795a61370d86fd6a4df5c8f4ab6c4fdeb80b /bin/puppetdoc
parent98dbfa2865ad270d5fd9821c6518f6f30ce9aec4 (diff)
downloadpuppet-068b61e022c42fb12a5c657cb9d1ebbd98c7ca38.tar.gz
puppet-068b61e022c42fb12a5c657cb9d1ebbd98c7ca38.tar.xz
puppet-068b61e022c42fb12a5c657cb9d1ebbd98c7ca38.zip
Removing obsolete references (they're in the indirection
reference), and adding error handling to puppetdoc.
Diffstat (limited to 'bin/puppetdoc')
-rwxr-xr-xbin/puppetdoc18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/puppetdoc b/bin/puppetdoc
index be86cc618..82e4c076b 100755
--- a/bin/puppetdoc
+++ b/bin/puppetdoc
@@ -128,11 +128,19 @@ else
else
with_contents = true
end
+ exit_code = 0
options[:references].sort { |a,b| a.to_s <=> b.to_s }.each do |name|
- section = Puppet::Util::Reference.reference(name)
-
- # Add the per-section text, but with no ToC
- text += section.send(options[:format], with_contents)
+ raise "Could not find reference %s" % name unless section = Puppet::Util::Reference.reference(name)
+
+ begin
+ # Add the per-section text, but with no ToC
+ text += section.send(options[:format], with_contents)
+ rescue => detail
+ puts detail.backtrace
+ $stderr.puts "Could not generate reference %s: %s" % [name, detail]
+ exit_code = 1
+ next
+ end
end
unless with_contents # We've only got one reference
@@ -147,6 +155,8 @@ else
else
puts text
end
+
+ exit exit_code
end