taxjar / taxjar-php

Sales Tax API Client for PHP 5.5+
https://developers.taxjar.com/api/reference/?php
MIT License
68 stars 24 forks source link

Format exception only when structure allows #35

Closed ScottRudiger closed 4 years ago

ScottRudiger commented 4 years ago

This PR fixes an issue where errors not directly related to the TaxJar API (GuzzleHttp exceptions, for example) were sometimes being improperly formatted to the way we display TaxJar-related errors, causing unhelpful error messages to be displayed.

For example, a customer received an error without any pertinent details: message : Trying to get property 'error' of non-object

After release, general exceptions will be passed along to the consumer with no change in the original structure to avoid these unhelpful errors.