avadev/AvaTax-REST-V2-JS-SDK

BUG: downloadTaxRatesByZipCode errors

kakhaUrigashvili opened this issue · 1 comments

downloadTaxRatesByZipCode errors

(node:56816) UnhandledPromiseRejectionWarning: #<Object>
(node:56816) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:56816) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I believe when response is csv, it still tried to parse it as json and parsing fails.

https://github.com/avadev/AvaTax-REST-V2-JS-SDK/blob/master/lib/AvaTaxClient.js#L92

https://github.com/avadev/AvaTax-REST-V2-JS-SDK/blob/master/lib/AvaTaxClient.js#L96

Please upgrade to the latest version of the SDK. Let us know if it is still an issue.
Thanks