LogErrorEvent - cWebApp
Logs an error event
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| iErr | Integer | Error number (from DFERR files) |
| sText | String | Error detail to be displayed in addition to the standard error message |
Syntax
Procedure LogErrorEvent Integer iErr String sText
Call Example
Send LogErrorEvent iErr sText
Description
LogErrorEvent logs an error event. An error event generates a normal error and explicitly logs this error to the Web Application's event log. Events can be viewed using the DataFlex WebApp Server Administration tool.
Most unexpected errors (program errors, syntax errors, etc.) are already automatically placed in the event log without any special programming on your part. This message should be used when you are sure the error should be added to the event log. If you are not logging an error event, do not use this message - use the LogEvent message.
DataFlex Code
Send LogErrorEvent iErr sText
Sample
Send LogErrorEvent 54321 'error description' // Unhandled Program Error - error number not in Err tables
Send LogErrorEvent 12345 'text to be added besides standard error text' // Minimum database client not found - found in DFErr003 (DBMS)
Send LogErrorEvent 13004 'text to be added besides standard error text' // Cannot read cache file signature - found in DFErr003 (DBMS)
Send LogErrorEvent 4109 'text to be added besides standard error text' // Data dictionary record not saved - found in DFErr001 (system)
Script Code
<% WBO.Call "msg_LogErrorEvent", iErr, sText %>
Registering Messages in the WBO
Before this message can be used within your script code, it must be registered within your WBO. This is done by sending the appropriate RegisterInterface message or by sending the RegisterFullErrorInterface message.
To register LogErrorEvent send one of the following:
Send RegisterInterface msg_LogErrorEvent "msg_LogErrorEvent" ;
"iErr sText" "This will log the event into the event log and generate a normal error "
Send RegisterFullErrorInterface