function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sarita Pa 3Sarita Pa 3 

Retrieve Error message From PlatForm Events

Hi All,
Good Morning.
I am trying to get the error message when i am using the below scenario

Here is Flow
Update Opp from UI --> (Invokes) BeforeOppUpdate.trigger --> (Publish message) PlatForm Event --> (Subscriber) Flow.

Trigger is getting saved successfully even if there is an error in 'Flow'.

Is there any way that i can catch the error in trigger and stop execution of trigger if flow throws an error.

Thank you very much for your quick response.

VinayVinay (Salesforce Developers) 
Hi Sarita,

Messages for platform event aren’t published for autolaunched flows or processes and Apex Triggers aren't supported.

https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/sforce_api_objects_flowexecutionerrorevent.htm

Try to use {!$Flow.FaultMessage} that captures the error message of the flow.

https://help.salesforce.com/articleView?id=flow_ref_resources_system_variables.htm
https://help.salesforce.com/articleView?id=flow_build_logic_fault_examples.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar