Permalink
Browse files

Fix exception handling response from zoho

  • Loading branch information...
1 parent 25a9175 commit 6f2b57a8229871ff1c0ef95c22ddfcfeeba1c563 @ryanwilliams ryanwilliams committed Jan 28, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/zohoho/connection.rb
View
6 lib/zohoho/connection.rb
@@ -22,10 +22,10 @@ def call(entry, api_method, query = {}, http_method = :get)
case http_method
when :get
- raw = JSON.parse(self.class.get(url, :query => query))
+ raw = JSON.parse(self.class.get(url, :query => query).body)
parse_raw_get(raw, entry)
when :post
- raw = JSON.parse(self.class.post(url, :body => query))
+ raw = JSON.parse(self.class.post(url, :body => query).body)
parse_raw_post(raw)
else
raise "#{http_method} is not a recognized http method"
@@ -60,4 +60,4 @@ def raw_to_hash(raw)
end
end
-end
+end

0 comments on commit 6f2b57a

Please sign in to comment.