diff options
author | Adam Mueller <adam.mathys@gmail.com> | 2020-07-21 14:09:17 -0700 |
---|---|---|
committer | Adam Mueller <adam.mathys@gmail.com> | 2020-07-21 14:09:17 -0700 |
commit | 13d41349671fe914d93a17eade80911aed887ca1 (patch) | |
tree | 7b4ae8c12d9528c7527095ab14d2769e251db166 /lib/super_good/solidus_taxjar | |
parent | e6af942deb798793324bdf8924b9c8e144184374 (diff) |
Fix handling of no results for address validation
According to the documentation, and some testing, the API will raise a
Taxjar::Error::NotFound error if the API finds no addresses. Instead of
raising this error to others, we should handle it ourselves and return
nil/an empty array like we originally intended.
https://developers.taxjar.com/api/reference/#post-validate-an-address
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r-- | lib/super_good/solidus_taxjar/addresses.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/super_good/solidus_taxjar/addresses.rb b/lib/super_good/solidus_taxjar/addresses.rb index 0993a03..de91af9 100644 --- a/lib/super_good/solidus_taxjar/addresses.rb +++ b/lib/super_good/solidus_taxjar/addresses.rb @@ -47,6 +47,8 @@ module SuperGood def taxjar_addresses(spree_address) api.validate_spree_address(spree_address) + rescue Taxjar::Error::NotFound + [] end def us |