Skip to content

Commit

Permalink
add Psych::SyntaxError to the list of rescued YAML exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed May 25, 2011
1 parent 5856fc5 commit cae1d46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions activesupport/lib/active_support/json/backends/yaml.rb
Expand Up @@ -7,6 +7,13 @@ module Yaml
ParseError = ::StandardError
extend self

EXCEPTIONS = [::ArgumentError] # :nodoc:
begin
require 'psych'
EXCEPTIONS << Psych::SyntaxError
rescue LoadError
end

# Parses a JSON string or IO and converts it into an object
def decode(json)
if json.respond_to?(:read)
Expand Down

0 comments on commit cae1d46

Please sign in to comment.