Several months ago, we noticed that our production org was not sending exception emails though we regularly were able to generate an exception email in sandboxes. We filed a case with support and after working with them, we found some unrelated deliverability issues but nothing tied to exception emails. This case was closed for being out of scope.
To rectify the deliverability issues, we went through the normal troubleshooting steps for email deliverability. We confirmed the following:
- Salesforce email deliverability best practices were properly configured.
- Exception emails were configured to send to the correct people.
- These users were configured to receive exception emails at a user level.
After another round of testing, we filed a second case with Salesforce support. With Salesforce supports assistance, we were able to confirm that our production org was not triggering exception emails with the exceptions we were using to test. There was some back and forth that this could be related to Known Issue W-1311052.
Knowing this could be a possibility based on what we were using to test, we ended up writing a method that would would cause a new unhandled exception in production. This method was testing in sandbox and an exception email was sent as expected. When the method was run in production, the unhandled exception was thrown but no email was sent and this was further confirmed by the email deliverability team. Tier 3 Support was able to check internal MTA logs to confirm that no email was triggered and it was confirmed at that point that our production org was not triggering emails to be sent during unhandled exceptions.
At this point, we were notified that this error was related to Apex, and that we currently do not have Premier Support so the case was closed for being out of scope. We tried explaining on multiple occasions to anyone who would listen that the unhandled exception emails are not something our custom code sends and its sent from Salesforce but to no avail.
My questions for this community:
- Has anyone else experienced this issue?
- Are their any suggestions of things we could try in regards to receiving these emails? (I’m primarily concerned about unhandled exceptions. We have the ability to monitor handled exceptions at the moment)
- Does anyone have any suggestions around getting around the Premier Support paywall? When I worked at an ISV, this was never an issue but now that I am a customer, support is more of a hindrance than a helper.
Has anyone else experienced this issue?
Yes. I’ve seen this previously with Apex Exception emails in 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?
I believe the answer there still stands. You won’t currently get one-to-one emails for every unhandled Apex exception and the mechanism that determines which exceptions get suppressed and which get sent is currently not publicly documented.
Are their any suggestions of things we could try in regards to receiving these emails? (I’m primarily concerned about unhandled exceptions. We have the ability to monitor handled exceptions at the moment)
At this stage the only mechanism I know of to catch unhandled exceptions are Transaction Finalizers on Queueables. These provide a post transaction point that will detect the exception that terminated execution.
Does anyone have any suggestions around getting around the Premier Support paywall?
That is a much more complicated issue that I don’t think we can fully address here. There are a number of community members that continue to advocate to Salesforce for improving the support for development related bugs without needing to pay for Premier support. It is often raised in places like Meet the Developers and True to the Core at various conferences.