Raising Exceptions
The OutSystems platform, out of the box, already provides a system to handle Exceptions. However, we can raise them in our code wherever we see fit. With this, we can gain greater control over unexpected events and process them in a more user-friendly and understandable way. Once again, it all comes down to being able to take a neat leap.
Something to bear in mind whenever we raise an Exception is that it will be logged and visible on the Service Center console, which allows us to subsequently have a more careful and in-depth analysis of anomalies and a more precise intervention.
We can perform raise Exceptions on our Server Actions, Service Actions, and Client Actions (these last two will be seen in Chapter 10, Client-Side Logic).
Whenever we foresee a possibility of unexpected behavior, through the decision elements seen in Chapter 6, Server-Side Logic (If
and Switch
), we can trigger an Exception of the following types:
- User Exceptions: Exceptions...