lib/stealth/services/facebook/client.rb in stealth-facebook-0.9.1 vs lib/stealth/services/facebook/client.rb in stealth-facebook-0.9.2

- old
+ new

@@ -31,11 +31,11 @@ def self.fetch_profile(recipient_id:, fields: nil) if fields.blank? fields = [:first_name, :last_name, :profile_pic, :locale, :timezone, :gender, :is_payment_enabled, :last_ad_referral] end - query_hash ={ + query_hash = { fields: fields.join(','), access_token: Stealth.config.facebook.page_access_token } uri = URI::HTTPS.build( @@ -48,10 +48,10 @@ Stealth::Logger.l(topic: "facebook", message: "Requested user profile for #{recipient_id}. Response: #{response.status}: #{response.body}") if response.status.in?(200..299) MultiJson.load(response.body) else - false + raise(Stealth::Errors::ServiceError, "Facebook error #{response.status}: #{response.body}") end end end end