Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:iron-io/iron_core_ruby

  • Loading branch information...
commit 5f3822c7b19b8e7601d589543a727494f6425373 2 parents 4c80044 + 5cac3eb
@iced iced authored
Showing with 8 additions and 3 deletions.
  1. +7 −2 lib/iron_core/client.rb
  2. +1 −1  lib/iron_core/iron_error.rb
View
9 lib/iron_core/client.rb
@@ -142,8 +142,13 @@ def parse_response(response, parse_json = true)
raise IronCore::IronResponseError.new(response) if response.code != 200
- return response.body unless parse_json
- JSON.parse(response.body)
+ # response in rest_client gem is a confusing object, of class String,
+ # but with 'to_i' redefined to return response code and
+ # 'body' defined to return itself
+ body = String.new(response.body)
+
+ return body unless parse_json
+ JSON.parse(body)
end
end
end
View
2  lib/iron_core/iron_error.rb
@@ -1,4 +1,4 @@
module IronCore
- class IronError < Exception
+ class IronError < StandardError
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.