lib/salesforce/connection.rb in activeforce-4.0.0 vs lib/salesforce/connection.rb in activeforce-5.0.0

- old
+ new

@@ -9,25 +9,25 @@ include SoapApi include RestApi include HttpMethods include Conversion include Async - + def self.as_logged_in_user(&block) - count = 0 + count = 0 begin Salesforce::Authentication.session_id block.call - rescue RestClient::Request::Unauthorized, Savon::SOAPFault => e + rescue RestClient::Unauthorized, Savon::SOAPFault => e if count < 1 && (e.message.downcase.include?("unauthorized") || e.message.downcase.include?("invalid_login")) count += 1 Salesforce::Config.on_login_failure Salesforce::Authentication.logout retry else raise e end end - + end end end