From a238148b1d66b9d5377b9c840b00b9e2ea4d4d7e Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Tue, 5 Feb 2019 10:36:04 -0800 Subject: Move exception handler configuration --- lib/super_good/solidus_taxjar.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/super_good/solidus_taxjar.rb') diff --git a/lib/super_good/solidus_taxjar.rb b/lib/super_good/solidus_taxjar.rb index be56453..663b3d8 100644 --- a/lib/super_good/solidus_taxjar.rb +++ b/lib/super_good/solidus_taxjar.rb @@ -13,9 +13,13 @@ module SuperGood class << self attr_accessor :discount_calculator attr_accessor :test_mode + attr_accessor :exception_handler end self.discount_calculator = ::SuperGood::SolidusTaxJar::DiscountCalculator self.test_mode = false + self.exception_handler = ->(e) { + Rails.logger.error "An error occurred while fetching TaxJar tax rates - #{e}: #{e.message}" + } end end -- cgit v1.2.3