antimattr/sears — pull request #3 by carawarner (2014-07-02 19:35:39+00:00)
Title: Hold exceptions until each export has been tried

An IntegrationException is thrown when the product, price, or inventory item you are exporting to Sears is missing some required parameter(s). If you attempt a bulk export, the entire operation will fail if any one item is incomplete.

This PR alters the way IntegrationExceptions are handled in the PricingRequestHandler, InventoryRequestHandler, and ProductRequestHandler. Instead of throwing an IntegrationException immediately, the RequestHandler will stash its details in an array and continue processing the rest of the items in the $collection. When every item has been processed, the exception array is json_encoded and returned in one go.

**Note:** the way I have it right now, export is never attempted if there are any IntegrationExceptions. This is a partial fix, but before I merge I want to ensure complete items are exported before the IntegrationException is thrown.

We might consider extending this change to the other RequestHandler classes.