The Error Handler is a generated Visual Adelia program named SVCERR.
By default, the SVCERR program supplied by HARDIS contains the same features as that included in v8.2. However, HARDIS also supplies a SVCERR_custom.dll program (to be renamed as MDWERR.dll) using the features presented below.
By default, an error when running a service always generates a message box.
The SVCERR_custom.dll program offers a new dialog box initialized using the values defined in the MwError.ini file.
The new options of MwError.ini can be fixed using the following macros:
- EXIT_ON_ERROR = 1 |
Used to interrupt the program. |
- REGISTER_ERROR = 1 |
Used to register an event in the Windows events log (Application section; ApplicationName=AdeliwsAPP or value contained in the macro REGISTER_APP_NAME). |
- REGISTER_APP_NAME = NomApp |
Application name used to register an event. |
- DISCONNECT_ON_ERROR = 1 |
Used to forcibly disconnect the logical server. |
Check boxes
Saving an event
2 possible cases:
If this box is checked and the user closes the box using the OK button, an event is created in the Windows log, and the application continues to run.
If this box is checked and the user closes the box using the Finish button, an event is created in the Windows log, and the application terminates.
Disconnect
If this box is checked and the user closes the box using the OK button, the logical server is disconnected and the application continues to run.
Whether this box is checked or not, when the user closes the box using the Finish button, the application terminates and the related logical server is disconnected.
Note: All the strings of this message box are to be found in the RTStrings.ini file.
In addition, a user who wants to write his own error handling program can write a VADELIA program named IBM SVCERR. This program must then replace the default one.
This program must define the following parameters:
NUM_BIN_4 |
SrvErrNb |
Service error number. |
BOOL |
IOMgt |
Input/output management. |
ALPHA(15) |
DefaultPGM |
Program name. |
ALPHA(30) |
LogServ |
Name of the logical server. |
NUM_BIN_4 |
ServNb |
Service number. |
Note: You can call the default handler from the new program by renaming the DLL of the default handler and by calling this program using the CALL instruction.
Example:
The Dll of the default program SVCERR has been renamed DEFSVCERR.
ALPHA(15) DEFAULTPGM
DEFAULTPGM = 'DEFSVCERR'
CALL &DEFAULTPGM MwErrNb IOMgt PgmName LogServ ServNb
Additional VaToolBx functions necessary to write an error handling program: