verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

Fix SurePost exception preventing additional rates from being fetched #33

Closed Mosnar closed 4 years ago

Mosnar commented 4 years ago

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.

engram-design commented 4 years ago

Good thinking, thanks!