(PDOC-71) Workaround for spurious error failures

This patch catches and reports on issues that have occurred during YARD
processing of the data to be processed.

The issue itself is not resolved but this does provide you with as much
documentation as can be reasonably generated for your materials without
crashing the build.

This was the result of the Baltimore Puppet Users Group Meetup of 22
June 2016.
This commit is contained in:
Trevor Vaughan 2016-06-22 21:39:41 -04:00
parent aa3682e3a6
commit e39b4f3533
1 changed files with 42 additions and 29 deletions

View File

@ -2,6 +2,7 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::HostClassHandler < PuppetX::
handles HostClassDefinition
process do
begin
obj = HostClassObject.new(:root, statement.pops_obj.name)
obj.parameters = statement.parameters.map do |a|
@ -38,5 +39,17 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::HostClassHandler < PuppetX::
end
register obj
rescue StandardError, SystemStackError => e
# If we hit this, we've thrown an exception somewhere that should be
# addressed but should not break the build.
#
# SystemStackError is being caught due to a presently untraced bug in
# either YARD or the Puppet Parser.
#
# Note: Documentation will *not* be generated for any item listed here,
# but you will get the rest of your documentation!
$stderr.puts("Ignored: #{e.inspect} at #{obj.title}")
end
end
end