postcode-nl / PostcodeNl_Api_MagentoPlugin

A Magento plugin 1.9 that implements the Postcode.nl API for Dutch addresses
BSD 2-Clause "Simplified" License
21 stars 12 forks source link

Improve error handling #37

Closed schmengler closed 7 years ago

schmengler commented 7 years ago

Customers were not able to continue with the checkout if the response was invalid. This happened regularly when the Postcode NL API was not available.

I added safeguards at two stages:

  1. catch exceptions in PHP and return the "validation service error" resposne
  2. handle exceptions in JS and fall back to manual input

The diff looks nicer with ignored whitespace.

MaartenScholder commented 7 years ago

Thank you, I like the 2 extra safeguards.

By the way, we use multiple own and 3rd party tools to monitor our uptime and performace, and aren't aware of significant availability problems of this API in the last few years.

Most common causes for error would be failed dependencies (i.e. out of date curl etc) or failed subscriptions, but also for such scenarios the user should be able to checkout. :)