You can use Exceptions to catch possible errors in the application. You can add exception handling to activities in Codolex. To do that, right-click on an activity in a flow, and choose "Add exception".
Then click on one of the +points of the activity to create the exception.
Make sure this point is connected to an alternative flow.
Save with exception handler
begin try HelpAndManualScreenshots.DataSource.Codolex.ShippersDataBroker.Save(ShippersList); var Connection := CodolexFramework.DatabaseQueryProvider['Codolex'].Connection; Connection.Commit; except on E: Exception do begin var Connection1 := CodolexFramework.DatabaseQueryProvider['Codolex'].Connection; Connection1.Rollback; end; end; end; |
Resulting code