diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-08-27 11:31:13 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-08-27 11:31:13 -0700 |
commit | 3a63e53c109a26f27a098028cf65882318d44099 (patch) | |
tree | 9cc9e84fad6a0d478384ca305e0af4e800339ab6 | |
parent | 5e489861dba968c011f7cd539d806ab45acc210a (diff) |
SureTax: additional debugging, RT#76987
-rw-r--r-- | FS/FS/TaxEngine/suretax.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/FS/FS/TaxEngine/suretax.pm b/FS/FS/TaxEngine/suretax.pm index fe8764bf1..356f5f318 100644 --- a/FS/FS/TaxEngine/suretax.pm +++ b/FS/FS/TaxEngine/suretax.pm @@ -347,7 +347,10 @@ sub make_taxlines { 'Accept' => 'application/json', ); - warn "received SureTax response\n" if $DEBUG; + warn 'received SureTax response: '. $http_response->status_line. "\n" + if $DEBUG; + die $http_response->status_line. "\n" unless $http_response->is_success; + my $raw_response = $http_response->content; warn $raw_response if $DEBUG > 2; my $response; @@ -360,7 +363,7 @@ sub make_taxlines { warn "decoding SureTax response\n" if $DEBUG; $response = eval { $json->decode($raw_response) } - or die "$raw_response\n"; + or die "Can't JSON-decode response: $raw_response\n"; # documentation implies this might be necessary $response = $response->{'d'} if exists $response->{'d'}; |