4GL JSP pages provide centralized error processing that reports errors occurring before page generation, such as errors generated when server events are triggered during page processing. When you display runtime errors for production pages, the messages tell your users about problems they might encounter when they view a page.
You enable the reporting of runtime errors on the Errors page of the Page Properties dialog box. You choose where the errors get displayed.
To enable reporting of runtime errors:
Right-click on a 4GL JSP page open in the HTML editor, then select Page Properties from the pop-up menu.
Click the Errors tab.
On the Errors page, select how you want runtime errors displayed.
You can display errors on a page, in an alert box, or in both places:
Another way to report runtime errors is by writing scripts that call methods and properties on the psPage object. The ReportError method triggers the ServerError event, then depending on the return value from ServerError, adds an error to the error log.
The psPage object has the following properties to support error reporting:
Use this property |
To do this |
---|---|
showErrorsOnPage |
Generate processing errors when the page is generated |
showErrorsAtTop |
Display processing errors at the top or bottom of the page |
showErrorsInAlert |
Display processing errors in a separate alert box |
To display errors elsewhere on a page, use the BeforeGenerate event to make sure the errors are available when the page generates.
The psPage object also has these methods for displaying errors:
Use this method |
To do this |
---|---|
WriteErrorsToDocument |
Define a precise location where error messages are to appear on a page |
TestCompError |
Check whether a method on an EAServer component caused any errors |
For more information about the methods and properties that support error reporting on the psPage object, see the online Web and JSP Target Reference.