Error Handling
In this section, we want to mention the types of errors that users may encounter when using the Portal, and how to enhance error handling approaches within the Portal.
Ajax error: These errors occur during a JSF Ajax request, such as when the user clicks the “Show Full Mode” button to switch the task widget to full mode. Without proper error handling, users receive no feedback if the action was unsuccessful.
Non-ajax error: These errors occur when a user accesses the Portal via a URL that cannot be processed successfully by the server, or when navigating to a corrupt URL. For example, this can happen if a user clicks a link to start a task that does not exist.
View expired error: These errors occur when a user submits a request for a page that no longer has an active view in the session, or when the user session has expired.
Ajax Error Handling
Introduction
By default, Portal handles all exceptions generated by Ajax requests.
When an exception occurs, the Portal shows an error notification with the
exception type and message to the end user. The exception details are available
when the user clicks on the More
link in the red error message.
The display of Stacktraces is controlled by the Ivy system property
Errors.ShowDetailsToEndUser
.
Note
This feature is only available if using the Portal default template
(BasicTemplate
) or a version extended from it.
Result
Non-Ajax Error Handling
Introduction
By default, when the server encounters an error such as HTTP 404
,
HTTP 500
or an exception while loading a page, the Axon Ivy Engine will show
a default error page. E.g.:
You can find the contents of this page in the file located at
${AxonIvyEngineFolder}/webapp/ivy/ivy-error-page.xhtml
, but the error page
is not user friendly. Thus, the Axon Ivy Portal provides an alternative solution
to make this page more understandable for end users.
How to Configure
Download the zip file below to configure on your engine (or designer).
Important
Read README.txt
Result
HTTP 404 Page Not Found
Example testing URL: 404
HTTP 500 Error
Example testing URL: 500
View Expired Dialog
Introduction
Ivy provides a warning dialog for the ViewExpiredException
,
located in the webContent/layouts/includes/exception.xhtml
file of your project.
If any dialog of your project is using IFrame In Portal, and encounters a ViewExpiredException
,
the default warning dialog will be displayed.
How to Configure
Portal also offers a customized dialog for this exception.
If you prefer to use the Portal’s customized dialog instead of the default one mentioned above,
please update the onexception
callback in the exception.xhtml
of your project using the following code snippet:
<p:ajaxExceptionHandler
type="javax.faces.application.ViewExpiredException"
update="viewExpiredExceptionDialog"
onexception="parent.PF && parent.PF('portal-view-expired-exception-dialog') ?
parent.PF('portal-view-expired-exception-dialog').show() :
PF('viewExpiredExceptionDialog').show()" />