You need to sign in to do that
Don't have an account?
Stefaan Somers 11
Raise BatchApexErrorEvent for queueable or scheduled classes
For Batchable classes you can extend it with Database.RaisesPlatformEvents so BatchApexErrorEvent is raised in case of errors.
Can we do something similar for Queueable or Scheduled classes. I tried to create BatchApexErrorEvent itself but apparently field Message is not writable....
Can we do something similar for Queueable or Scheduled classes. I tried to create BatchApexErrorEvent itself but apparently field Message is not writable....
You can catch the exceptions and publish your own PlatformEvents "manually".Example of things that do this are logger frameworks like Nebula(https://github.com/jongpie/NebulaLogger) and the one bobbywhitesfdc wrote i.ehttps://github.com/bobbywhitesfdc/LoggingFramework
Thanks.