TraceError PowerScript function
Description
Logs your own error message and its severity level to the
trace file if tracing of this activity type has been enabled.
Syntax
|
1 |
<span>TraceError </span><span></span>( <span>severity</span>, <span>message </span>) |
|
Argument |
Description |
|---|---|
|
severity |
A long whose value is a number you want |
|
message |
A string whose value is the error message |
Return Values
ErrorReturn. This function always returns Success!.
If severity or message is null, TraceError returns null and
no entry is made in the trace file.
Usage
TraceError logs an activity type value
of ActError! to the trace file if you enabled the tracing of this
type with the TraceEnableActivity function and
then called the TraceBegin function. You use
the TraceError function to record your own error
message. It works just like the TraceUser function
except that you use it to identify more severe problems. The severity and message values
are passed without modification to the trace file.
Examples
This example logs an error message to the trace file
when a database retrieval fails:
|
1 |
dw_1.SetTransObject(SQLCA) |
|
1 |
|
1 |
TraceUser(100, "Starting database retrieval") |
|
1 |
IF dw_1.Retrieve() = -1 THEN |
|
1 |
<span> TraceError</span>(999, "Retrieve for dw_1 failed") |
|
1 |
ELSE |
|
1 |
TraceUser(200, "Database retrieval complete") |
|
1 |
END IF |