Shopify / active_shipping

ActiveShipping is a simple shipping abstraction library extracted from Shopify
http://shopify.github.io/active_shipping
MIT License
812 stars 546 forks source link

Sort FedEx tracking response error codes between retryable and not #422

Closed jonathankwok closed 7 years ago

jonathankwok commented 7 years ago

Resource: https://www.fedex.com/us/developer/WebHelp/ws/2014/dvg/WS_DVG_WebHelp/index.htm#Appendix_O_Error_Code_Messages.htm

Summary

Error codes are more extensive than known in FedEx, and for some errors, they were continuing past the error code check because they weren't known in the case. From the resource, I sorted the tracking errors (9xxx) between transient and non-transient, on the basis of whether the message contains "Please retry later" or not.

This strategy aligns with what I've seen with existing numbers (e.g. 9080 is the error returned when I tried to track something with code BadTrackingCode, and the error response doesn't prompt a retry.)

As for the error classes being returned, I'm maintaining the current return pattern; ShipmentNotFound for transient errors, and ResponseContentError otherwise. Not great, but that's part of a larger scale rework coming later.

@iWuzHere @kmcphillips