Portlet Factory, Version 6.1.2
Catching and handling an error in a model
Use the Error Handler builder to catch and handle any unhandled error or all errors encountered when the model runs.
- Add an Error Handler builder to the model.
- Assign the builder to an action.
- Specify one of the following builder inputs:
- Try Action
This is the action for the builder to monitor, for example, the loading of a particular page.
- Catch Action
This is the action for the builder to initiate if an exception occurs. For example, you can invoke a method or display a specific error-related page.
- Add more Error Handler builders to the model.
With multiple Error Handler builders in a model, you can monitor exceptions at various levels. For example, you can assign as the try action a page action, a method action, or an individual action in an action list.
- To work with a specific type of exception in a method, in the Error Handler builder, specify an Exception Class input.
The indirect reference widget for this builder input allows you to select a Java class in your project. This technique allows you to assign multiple Error Handler builders to multiple exceptions on the same method or model.
- To catch and handle any unhandled errors encountered when the model is run, set Catch all Errors.
Parent topic: About handling errors for individual model actions
Library | Support |