OpenWGA 7.7 - TMLScript reference
WGAMethod :
logException([msg, ] error)
On object | WGA |
Usage |
Logs a JavaScript exception as WebTML warning and in application log |
Description |
This is a convenience method to cope with unexpected exceptions in TMLScript code, so that they are logged and can be analyzed. All exceptions in JavaScript at first are JavaScript Errors but their cause may be a real JavaScript failure or a wrapped Java exception, which is tedious to test. This method copes with both cases and tries to log all information that is available in the situation:
|
Parameters |
msg (String, Optional): A message that is put out with the error error: An Error object like it is thrown in TMLScript. |
Allowed in script types |
|
Examples |
The following code template may be used in all TMLScripts with longer/more complicated operations, which may throw unexpected errors. The whole procedure is wrapped in a try/catch block. In the catch block the caught error is logged via logExcepion(): try { |