In my particular use case, saving the revised object mapping was experiencing a duplicate key violation on save. This produces a PDO Exception which is reported as "Error The website encountered an unexpected error. Please try again later." on a blank white screen during a Commerce checkout process. The SF Push occurs during the payment processing step, if the transaction is approved.
To end users the disconcerting error screen would show up and if reloaded they would get an all green that their purchase went through. A number of users expressed confusion and the site owners insisted the error message be dealt with.
For a variety of reasons the root issue causing the problem couldn't be fixed - there's a patch for that already in place that apparently isn't working as intended. However, since there is a patch in place and the problem is still occurring, this kind of problem could easily occur with other patches or in other hook or alter functions - and their failures should bring the whole system down.
As a result, the route I've taken to fix the problem is to add try/catch pairs to the salesforce_push_entity_crud function in two locations: the module_invoke section and the salesforce_push_sync_rest call. The former takes care of contrib/custom hook functions exceptions and the latter takes care of standard sync rest ops, such as the one causing my problems. The exceptions are recorded to the syslog so they can be tracked, but the potentially confusing error screen is avoided.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2875837-graceful-crud.patch | 1.35 KB | ironsizide |
Comments
Comment #2
ironsizide commentedComment #3
aaronbauman7.x is no longer supported