Service Studio provides the Error Handler element to handle exceptions. This element can be used in the action flow or screen flow. An error handler catches a specific exception.

There is a call hierarchy for exceptions that determines the error handler behavior:

Exception Handling Mechanism

Whenever an exception is raised the execution is interrupted and continues in the Error Handler that is suited to handle the exception.

To select the Error Handler for an exception, the OutSystems Platform proceeds as follows:

    1. In the current action, find out if there is an error handler for the specific exception that was raised;

    2. In the current action, find out if there is a generic error handler;

    3. Follow the caller stack until an error handler is found or the end of the stack is reached;

    4. When a suitable error handler is found, execute its logic and continue processing the end-user request.



    In the scenario above, when the GetCityWeather action raises an InvalidWSResponse user exception, the error handling mechanism works as follows:

Error Handling Flow

To avoid displaying generic error messages to end-users, it is possible to define a global error handler, that is checked if no error handler is found in the caller stack:

See Also

Error Handler Properties | Types of Exceptions