shippo-ruby-client icon indicating copy to clipboard operation
shippo-ruby-client copied to clipboard

Rescue gracefully not found error for detailed responses

Open DanielYouCan opened this issue 5 years ago • 3 comments

When creating a manifest with invalid data and bad request error should be returned, GoShippo API instead returns 404 Not found error. Gem should be able to rescue such errors until proper error will be returned on server side.

DanielYouCan avatar May 04 '20 08:05 DanielYouCan

Thanks for making a pull request! We are still attempting to figure out how to handle SDK support (especially for this gem). There are a number of things that haven't been included in this API wrapper (like our orders endpoint-> https://goshippo.com/docs/reference#orders).

I've been working with manifests quite a bit recently with customers and think a more specific error response code would be helpful!

What sort of error response message were you expecting?

Was there something wrong with the manifest request that we should have surfaced for you?

For example you can only setup a manifest (aka scanform) with USPS for domestic mail (not PR or MIL addresses) but currently we don't out out the difference between those and say a tracking number that has already been included in another manifest.

jfriedr avatar May 05 '20 15:05 jfriedr

@jfriedr GoShippo API returns such error and 404 not found.

"Invalid transactions (transaction_id) for manifest request. Please check that the carrier (carrier) matches, that the transactions are of the same date (date), that the transactions have the correct zip code (zip code), and that the transactions have not been assigned to a different manifest."

But the gem doesn't handle this properly and loses such errors. As you can see such errors can happen if a shipment has different pickup date, address zip code or carrier than manifest

DanielYouCan avatar May 14 '20 07:05 DanielYouCan

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Jun 16 '22 20:06 sonarqubecloud[bot]