Skip to content

Commit 5639828

Browse files
committed
(maint) also catch Psych::SyntaxError
Psych::SyntaxError is a RuntimeException. This still needs to catch that. This was uncovered by the recent move to catch StandardError rather than the catchall Exception that was here before.
1 parent 3860512 commit 5639828

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/puppet/parser/functions/parseyaml.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ module Puppet::Parser::Functions
1616

1717
begin
1818
YAML::load(arguments[0]) || arguments[1]
19-
rescue StandardError => e
19+
# in ruby 1.9.3 Psych::SyntaxError is a RuntimeException
20+
# this still needs to catch that and work also on rubies that
21+
# do not have Psych available.
22+
rescue StandardError, Psych::SyntaxError => e
2023
if arguments[1]
2124
arguments[1]
2225
else

0 commit comments

Comments
 (0)