mini_fb 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mini_fb.rb +15 -7
- metadata +1 -1
data/lib/mini_fb.rb
CHANGED
@@ -166,13 +166,21 @@ module MiniFB
|
|
166
166
|
return response.body if custom_format
|
167
167
|
|
168
168
|
fb_method = kwargs["method"]
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
169
|
+
body = response.body
|
170
|
+
|
171
|
+
begin
|
172
|
+
data = JSON.parse( body )
|
173
|
+
puts 'response=' + data.inspect if @@logging
|
174
|
+
if data.include?( "error_msg" ) then
|
175
|
+
raise FaceBookError.new( data["error_code"] || 1, data["error_msg"] )
|
176
|
+
end
|
177
|
+
|
178
|
+
rescue JSON::ParserError => ex
|
179
|
+
if fb_method == "users.getLoggedInUser" # Little hack because this response isn't valid JSON
|
180
|
+
return body
|
181
|
+
else
|
182
|
+
raise ex
|
183
|
+
end
|
176
184
|
end
|
177
185
|
return data
|
178
186
|
end
|