Closed Saggre closed 2 years ago
Dear @Saggre thanks for the PR.
Do you have an example of the API response that is causing this unexpected response you are mentioning?
@bilfeldt the following API response will cause it as the message field is empty.
{
"links": {
"about": "https://app.smartsend.io/docs/errors/NotFoundHttpException",
"status": "https://app.smartsend.io/status"
},
"id": null,
"code": "NotFoundHttpException",
"message": "",
"errors": []
}
Thanks for your PR @Saggre
This has been addressed on our central API and a future update to the entire API client included in this plugin will be taking place. Due to that then I will put this off for now.
Fixes a problem caused by error message being an object and being handled as a string in some edge cases https://github.com/smartsendio/woocommerce/blob/4d754e409e883d602833d103881eb62d8da9dd0f/smart-send-logistics/includes/lib/Smartsend/Client.php#L153-L184