When are unhandled exception emails suppressed and not sent? or Why do I not always get exception emails even though I've set them up?
Found this interesting statement in the idea Need a reliable developer script exception alert mechanism:
Salesforce R&D has acknowledged the issue but states it is a feature frozen area therefore, there is no known issue is being worked on. R&D is planning to replace this feature with full-featured exception handling/notification/management system.
Unfortunately there isn't a case number that could provide further reference around that statement.
There is also the known issue Single error email would be sent out for all identical unhandled Apex exception:
"The developer specified in the LastModifiedBy field receives the error via email with the Apex stack trace and the customer’s organization and user ID. No other customer data is returned with the report. Note that for Apex code that runs synchronously, some error emails may get suppressed for duplicate exception errors."
However, the Salesforce framework may suppress additional emails not mentioned here. Only one error email is sent out for all identical unhandled Apex exceptions
That certainly suggests that there are scenarios where "identical" exceptions will be suppressed. Unfortunately, that just moves the question down to defining what makes two exceptions identical.
September 2020 update:
Another Known Issue has been acknowledged - Missing Unhandled Apex Exceptions Emails.
Sometimes customers will not receive all of the expected Apex Exception Emails when a runtime unhandled exception occurs in their code.
There is an instance-wide limit of a few hundred exception emails per hour. Because of this, the exception email quota can be used by few orgs on the instance, depriving other orgs from receiving all of the exception emails occurring in the same hour.
So, even with the an entirely new and unseen exception, you might not get the error email if other tenant orgs are throwing lots of errors.
I've asked around a few sources. For a number of reasons you are unlikely to get a better answer around exactly how it works (or doesn't in some cases). Unfortunately that includes what constitutes an exception that will get suppressed.
Voting for the idea above is currently the best course of action for improving the current exception reporting mechanism long term.
Ralph,
One of the things to check is if the Send Apex Warning Emails checkbox is checked on the respective User record for those specific Users within your Salesforce instance.
Also as per this Knowledgebase Article,
The Send Apex Warning Emails settings on the User record only controls whether or not you get Apex warning emails every time that an Apex surpasses more than 50% of allocated governor limit. This is available in DE, EE and UE Editions only.
Other thing to note as per this Knowledgebase Article is
Unhandled exception emails are sent by default to the developer specified in the LastModifiedBy field on the failing class or trigger. In addition, you can have emails sent to users of your Salesforce org and to arbitrary email addresses.
To set up these email notifications within your Salesforce instance, from Setup, enter Apex Exception Email in the Quick Find box, then select Apex Exception Email. You can either add existing Salesforce Users or you can include external email addresses who can be notified in case of exception emails. You can also configure Apex exception emails using the Tooling API object ApexEmailNotification.