Because SurePost fetches its rate independently, it's possible for an exception to be thrown and break rate-fetching. SurePost has smaller allowed shipping dimensions than other shipping methods and when this limitation is hit, an InvalidResponseException is thrown. This wraps the getRate() method call with a try-catch to allow other shopped rates to be returned.
Because SurePost fetches its rate independently, it's possible for an exception to be thrown and break rate-fetching. SurePost has smaller allowed shipping dimensions than other shipping methods and when this limitation is hit, an
InvalidResponseException
is thrown. This wraps thegetRate()
method call with a try-catch to allow other shopped rates to be returned.