Skip to content

Commit

Permalink
Fix rescue clause for MagLev
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Aug 19, 2012
1 parent c286872 commit 39abdf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/multi_json.rb
Expand Up @@ -90,9 +90,11 @@ def load_adapter(new_adapter)
# <tt>:adapter</tt> :: If set, the selected engine will be used just for the call.
def load(string, options={})
adapter = current_adapter(options)
adapter.load(string, options)
rescue adapter::ParseError => exception
raise DecodeError.new(exception.message, exception.backtrace, string)
begin
adapter.load(string, options)
rescue adapter::ParseError => exception
raise DecodeError.new(exception.message, exception.backtrace, string)
end
end
# :nodoc:
alias :decode :load
Expand Down

0 comments on commit 39abdf5

Please sign in to comment.