lib/soaspec/o_auth2.rb in soaspec-0.2.0 vs lib/soaspec/o_auth2.rb in soaspec-0.2.1
- old
+ new
@@ -34,10 +34,10 @@
# @param [String] api_username Username to use which can be set by Soaspec::ExchangeHandler
def initialize(params_sent, api_username = nil)
self.retry_count = 0 # No initial tries at getting access token
params = params_sent.transform_keys_to_symbols
params[:token_url] ||= Soaspec::OAuth2.token_url
- raise 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
+ raise ArgumentError, 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
raise ArgumentError, 'token_url mandatory' unless params[:token_url]
self.params = params
params[:username] = api_username || ERB.new(params[:username]).result(binding) if params[:username]
params[:security_token] = ERB.new(params[:security_token]).result(binding) if params[:security_token]
params[:token_url] = ERB.new(params[:token_url]).result(binding) if params[:token_url]
\ No newline at end of file