New Status Codes for Event Publishing Failures

When publishing an event message fails, due to the publishing service being unavailable or a limit being exceeded, the returned SaveResult contains the error with a status code.

Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.

The following status code has been added.

PLATFORM_EVENT_PUBLISHING_UNAVAILABLE
Publishing platform event messages failed due to a service being temporarily unavailable. Try again later.

The following status code is returned when publishing event messages exceeds a limit. Previously, an unspecified error was returned.

LIMIT_EXCEEDED
The number of published platform event messages exceeded the hourly publishing limit or the test limit for event messages published from an Apex test context.