Exercise 3 – raising and handling an Exception
In this exercise, we will implement a raise Exception and its handler to handle calls made to the Ticket_CreateOrUpdate
Server Action by users who are not registered (who did not authenticate themselves through a set of credentials on a login page):
- Put the Check Registered roles in our flow, use If to validate the result, and, in case of failure, set the raise Exception:
- Click on the Logic tab, expand the Roles folder, expand the Registered role, and drag the CheckRegisteredRole Action to our flow, right after the start, as shown in Figure 7.5:
- Drag and drop an If from the toolbox to the flow, right after the CheckRegisteredRole Action, and in the condition, validate whether the return of that same Action is True, as shown in Figure 7.6: