avadev / AvaTax-REST-V2-PHP-SDK

Sales Tax API SDK for PHP and AvaTax REST
https://developer.avalara.com/sdk/
Apache License 2.0
48 stars 96 forks source link

AS-117: github issue 83 and 47 to handle truncated error messages #183

Closed svc-developer closed 2 years ago

svc-developer commented 2 years ago

This PR will take care of the following github issues:

Earlier the error messages were truncated like the following: "Client error:POST https:\/\/sandbox-rest.avatax.com\/api\/v2\/transactions\/createresulted in a401 Unauthorizedresponse:\n{\"error\": {\"code\": \"AuthenticationException\",\"message\": \"Authentication failed.\",\"details\": [{\"code\": \"AuthenticationExc (truncated...)\n"

Post fix, the error message would look like the following: "{\"error\": {\"code\": \"AuthenticationException\",\"message\": \"Authentication failed.\",\"details\": [{\"code\": \"AuthenticationException\",\"message\": \"Authentication failed.\",\"description\": \"Missing authentication or unable to authenticate the user or the account.\",\"faultCode\": \"Client\",\"helpLink\": \"http:\/\/developer.avalara.com\/avatax\/errors\/AuthenticationException\"}]}}"

This was explained in detail here: https://laracasts.com/discuss/channels/general-discussion/guzzle-error-message-gets-truncated?page=1&replyId=127348