Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

apparently ruby 1.9 wants me to raise exceptions differently

  • Loading branch information...
commit 65b818e1af632a65e93505135f197d9838be9d8b 1 parent 73f7473
@technoweenie technoweenie authored
View
4 lib/faraday/response/active_support_json.rb
@@ -23,8 +23,8 @@ def initialize(app)
def self.parse(body)
ActiveSupport::JSON.decode(body)
- rescue Object => err
- raise Faraday::Error::ParsingError.new(err)
+ rescue Object
+ raise Faraday::Error::ParsingError, $!
end
end
end
View
4 lib/faraday/response/yajl.rb
@@ -19,8 +19,8 @@ def initialize(app)
def self.parse(body)
Yajl::Parser.parse(body)
- rescue Object => err
- raise Faraday::Error::ParsingError.new(err)
+ rescue Object
+ raise Faraday::Error::ParsingError, $!
end
end
end
View
2  test/response_middleware_test.rb
@@ -25,7 +25,7 @@ class ResponseMiddlewareTest < Faraday::TestCase
define_method "test_use_#{key}_to_raise_Faraday_Error_Parsing_with_no_json_content" do
assert_raises Faraday::Error::ParsingError do
- response = create_json_connection(encoder).get('bad_json')
+ create_json_connection(encoder).get('bad_json')
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.