TransWikia.com

Salesforce Exception Emails Don't Send

Salesforce Asked on October 4, 2021

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:

  1. Salesforce email deliverability best practices were properly configured.
  2. Exception emails were configured to send to the correct people.
  3. 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:

  1. Has anyone else experienced this issue?
  2. 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)
  3. 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.

2 Answers

Our case was eventually escalated and, at some point, a new known issue was issued related to our case. W-7955758.

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.

Huge shout out to @Daniel-Ballinger for the existing documentation on this topic that helped get this moved through support.

Correct answer by BrBarr on October 4, 2021

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.

Answered by Daniel Ballinger on October 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP