While creating or running an application, errors may occur. Such errors must be detected, analysed and corrected.
Finding errors in scripts
INFO system:
Most errors can be detected in the INFO system in
/Errors/Script. Each error is listed with description, the row and column number in the script.
Writing user defined log entries into the INFO system:
Some errors in the script can be more "tricky". For example the error can be of semantic origin instead of syntactic, i.e. the script is running, but not exactly the way it should be.
The cause of such error the
Pm.Debug method can be used (or the
Pm.InfoLogAdd method) and e.g. so-called "
interval bisection". It means that somewhere in the application this method is placed into the script (together with the tuning remark as a first parameter). Then it is possible to check the script completion in the running application and see the "tuning note" in the
Debug item of the INFO system. This information can be useful in order to decide whether the error occured in the script
before or
after the remark.
Web panels:
The
Pm.Debug method and the
Pm.InfoLogAdd method works also in the Web client and the report can be viewed by pressing the
Shift+CtrlAlt+space key simultaneously in the
Web panel (or by pressing the
F12 key on the
"Console" tab).
Long term application error observation
Information about errors that is written into the
INFO system is visible only if the application is running or stopped (in runtime and in the development environment).
If the application is closed, the error information is lost.
Saving error information into the LOG file:
The global errors can be written into the
Application.log file.
This kind of error log can be set in the
Application.ini file in the
[Log] section.
The LOG file can then be explored long after the application is launching or stopped.
The error log is preset to record only the first occurrence of errors of each type.
Individual error logs:
The
onAppError event of the
PmaRoot object also can be used for example:
- creating own error log file
- writing error event into alarms and events
Application restart
There are situations that are not likely to occur during short term running of the application. For example:
- after Windows OS restart, the application is launched before all Windows services necessary for running it are active
- the connection with communication device is not re-estabilished after network breakdown, etc.
The application launch can be postponed for example by:
If the application or the
Windows OS "freezes" the
PmRtManager as WatchDog security component can be used for forcing the restart.