Platform Event Error Status Codes
When publishing an event message results in an error, a status code is returned in the
SaveResult.
Synchronous Errors
The following error status codes are returned immediately in the publish call result.
- 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.
- PLATFORM_EVENT_PUBLISHING_UNAVAILABLE
- Publishing platform event messages failed because a service was temporarily unavailable. Try again later.
- PLATFORM_EVENT_ENCRYPTION_ERROR
- The platform event messages could not be published due to a problem with encryption. A misconfiguration in your Salesforce org or a general encryption service error can cause this problem.
In Apex, the status code is returned in the Database.SaveResult in the Database.Error object. In SOAP API, the status code is returned in the SaveResult object. In REST API, the status code is returned in the errors field in the JSON message.