Newer Version Available
BatchApexErrorEvent
Notifies subscribers of errors and exceptions
that occur during the execution of a batch Apex class. This object is available in
API version 44.0 and later.
Batch Apex classes can fire platform events when encountering an error or exception. Clients listening to the event channel can tell how often it failed, which records were in scope at the time of failure, and other exception details.
Supported Calls
describeSObjects()
Supported Subscribers
| Subscriber | Supported? |
|---|---|
| Apex Triggers | ![]() |
| Flows | ![]() |
| Processes | ![]() |
| Streaming API (CometD) | ![]() |
Streaming API Subscription Channel
/event/BatchApexErrorEvent
Special Access Rules
Only the Salesforce Platform can fire this event; Apex code and the API cannot. Users with Customize Application Permission have read access.
Fields
| Field Name | Details |
|---|---|
| AsyncApexJobId |
|
| DoesExceedJobScopeMaxLength |
|
| ExceptionType |
|
| JobScope |
|
| Message |
|
| Phase |
|
| ReplayId |
|
| RequestId |
|
| StackTrace |
|
Usage
BatchApexErrorEvent messages are generated by batch Apex jobs that implement the Database.RaisesPlatformEvents interface and have unhandled Apex exceptions during processing. For more information, see the Apex Developer Guide.
