Permalink
Browse files

Fix rescue clause for MagLev

  • Loading branch information...
1 parent c286872 commit 39abdf50199828c50e85b2ce8f8ba31fcbbc9332 @timfel committed Aug 19, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/multi_json.rb
View
8 lib/multi_json.rb
@@ -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

0 comments on commit 39abdf5

Please sign in to comment.