EasyPost / easypost-java

EasyPost Shipping API Client Library for Java
https://easypost.com/docs/api
MIT License
54 stars 37 forks source link

[Bug]: SDK not returning expected error message for incorrect Address #336

Closed LWhitakerEasypost closed 1 month ago

LWhitakerEasypost commented 1 month ago

Software Version

v7.4.3

Language Version

java 17.0.9 2023-10-17 LTS

Operating System

Locally macOS 14.6.1, deployed to kube-helm ECR img OS/Arch: Linux, x86-64, ARM 64

What happened?

I noticed another issue with the SDK behaving slightly differently from the API for the shipments API.

I tried calling the shipment API with an invalid address and it returned this error under the messages array with no rates. Shipment ID - "shp_a712a50b452c4c3fade8a9a959964470"

"messages": [ { "type": "rate_error", "carrier": "USPS", "message": "400 Bad Request, response: {\"code\":\"BAD_REQUEST\",\"message\":\"The request could not be understood by the server due to malformed syntax.\",\"errors\":[\"dest zipcode format must be zzzzz[pppp]\"]}" } ]

If I pass the same address to the SDK, it returns an empty messages array along with rates and no error. Shipment ID: "shp_9d892632034c4a79a0cece2f2831835d"

What was expected?

I would expect the SDK response to be the same as when I hit the API directly.

Sample Code

No response

Relevant logs

No response

nwithan8 commented 1 month ago

Thank you for letting us know. We are moving communication on this to internal channels.