lib/salesforce/connection.rb in activeforce-1.10.5 vs lib/salesforce/connection.rb in activeforce-2.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::Unauthorized, Savon::SOAP::Fault => e + rescue RestClient::Request::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 \ No newline at end of file +end