(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:
parent
3860512d56
commit
5639828bff
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue