nateleavitt / infusionsoft

Ruby Gem for the Infusionsoft API
MIT License
58 stars 70 forks source link

undefined local variable or method `api_logger' for #<InfusionAPIError: InfusionAPIError> #21

Closed hamiltonm closed 10 years ago

hamiltonm commented 11 years ago

a = Infusionsoft.new(:api_key => "Asdf", :api_logger => Logger.new("#{Rails.root}/log/infusionsoft_api.log")) res = a.contact_add({:FirstName => 'first_name', :LastName => 'last_name', :Email => 'test@test.com'}) Expected to get an error as invalid api_key, etc.... However:- Error is generated and not entered into the infusionsoft_api.log api_logger method not found.

hamiltonm commented 11 years ago

Do have a fix, do not know if it is good enough though.

  1. in connection.rb class InfusionAPIError < StandardError add include Infusionsoft::Configuration Then the log does not show the error. my fix for that is
  2. in connection.rb add api_logger.error "ERROR: #{e.to_s}" before raise InfusionAPIError.new(e.to_s, e)
nateleavitt commented 10 years ago

Hello.. try the latest gem 1.1.7