(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.
This commit is contained in:
David Schmitt 2016-04-07 11:47:42 +01:00
parent 3860512d56
commit 5639828bff

View file

@ -16,7 +16,10 @@ be returned if the parsing of YAML string have failed.
begin
YAML::load(arguments[0]) || arguments[1]
rescue StandardError => e
# in ruby 1.9.3 Psych::SyntaxError is a RuntimeException
# this still needs to catch that and work also on rubies that
# do not have Psych available.
rescue StandardError, Psych::SyntaxError => e
if arguments[1]
arguments[1]
else