(#22471) Rescue errors specific to the YAML parser

The different yaml parsers, which are used in different versions of ruby,
end up throwing incompatible errors when loading data. The
Psych::SyntaxError that is thrown by the ruby 1.9 Psych parser is not
catchable by a generic `rescue => detail` block. Instead it needs to
explicitly call out the errors that need to be rescued.