4

To better reproduce and understand errors of our managed package that only occurr in customer orgs we cannot only rely on Subscriber support or logging. This is for multiple reasons, hard to repeat batch processes, Log files to big to yield errors and other platform specifics are some of them.

As an extra safety net we started to receive and store all error messages sent out by our package but in 9 out of 10 errors in a customer org no error email is sent out. It really looks randomly. We first thought only Async processes don't sent out email, but they sometimes do.

Is there any authorative answer when such emails are sent and when not? I know this is a duplicate of Not receiving all Apex Exception emails for Managed Package but I can't put a bounty on somebody elses question.

2

Salesforce support told me (in Case 14051137) the following:

The framework that sends email notifications when unhandled exceptions occur implements a complex suppression logic to avoid being too noisy. In a nutshell its logic is explained at https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_exception_definition.htm.

However the note on async jobs is incorrect, as same behaviour is experienced in both sync and async jobs. Basically notification of unhandled exceptions is handled by the gack framework that implements a complex suppression logic, and makes receiving these non-deterministic. Best approach is to implement try and catch that will cover all "catchable" events (it will not include the "uncatchable" ones such as hitting governor limits or internal server errors)

Unfortunately the suppression logic uses rate limits and cache that make email notification non-deterministic from a developer's point of view, but the decision to suppress notification is always performed according to its logic.

Also as per the internal discussion, it was suggested internally that this framework should be replaced with a different mechanism that could stream all the errors and persist them into a repository. Unfortunately, there is no ETA for the same as of now for the same.

As a next step we would encourage you to support the same by raising an IDEA at our portal for "enhanced exception notification without any suppression". So that we can get this implemented accordingly.

Please vote for the Idea "Enhanced exception notification without any suppression to package owner" that I submitted as a follow-up.

1
  • This is good to know. Thanks for clarification. Hopefully more folks vote for the idea to improve this. – CoryCowgill Jun 30 '16 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.