lib/bobot/graph_facebook.rb in bobot-5.0.1 vs lib/bobot/graph_facebook.rb in bobot-5.0.2
- old
+ new
@@ -13,11 +13,11 @@
url,
params: URI.encode_www_form(query.reverse_merge(include_headers: false)),
headers: GRAPH_HEADERS,
ssl_verifypeer: false,
)
- json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue ::JSON::ParserError nil)
+ json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue nil)
Bobot::ErrorParser.raise_errors_from_html(response, graph_body) if json.nil?
unless Rails.env.production?
Rails.logger.debug "[GET] >> #{url}"
Rails.logger.debug "[GET] << #{json}"
end
@@ -34,11 +34,11 @@
params: URI.encode_www_form(query.reverse_merge(include_headers: false)),
body: graph_body,
headers: GRAPH_HEADERS,
ssl_verifypeer: false,
)
- json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue ::JSON::ParserError nil)
+ json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue nil)
Bobot::ErrorParser.raise_errors_from_html(response, graph_body) if json.nil?
unless Rails.env.production?
Rails.logger.debug "[POST] >> #{url}"
Rails.logger.debug "[POST] << #{json}"
end
@@ -55,10 +55,10 @@
params: URI.encode_www_form(query.reverse_merge(include_headers: false)),
body: graph_body,
headers: GRAPH_HEADERS,
ssl_verifypeer: false,
)
- json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue ::JSON::ParserError nil)
+ json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue nil)
Bobot::ErrorParser.raise_errors_from_html(response, graph_body) if json.nil?
unless Rails.env.production?
Rails.logger.debug "[DELETE] >> #{url}"
Rails.logger.debug "[DELETE] << #{json}"
end