Errorhandling

Function

Description

uError

Writes an error text into log and signal an error

uErrortext

Returns the last error message

uWarning

Writes a warning message into log

uInfo

Writes an informal message into log

uTrace

Writes a trace message into log

uTracelevel

Sets the detail level of trace messages in the log




uError

Description

Writes an error text into log and signal an error

Syntax

string uError(errortext)

Parameters

string errortext

Text to write to log file

Examples

Example 1

Signal an error

uError("'PP' is no valid country key.")



uErrortext

Description

Returns the last error message

Syntax

string uErrortext()

Examples

Example 1

uErrortext() // returns last error text



uInfo

Description

Writes an informal message into log

Syntax

string uInfo(infotext)

Parameters

string infotext

Text to write to log file

Examples

Example 1

Log an informal message

uInfo("21445 records selected.")



uWarning

Description

Writes a warning message into log

Syntax

string uWarning(warningtext)

Parameters

string warningtext

Text to write to log file

Examples

Example 1

Log a warning message

uWarning("The attribute for the customer name is null.")



uTrace

Description

Writes a trace message into log.

You must manually set the trace level to 1 atleast before invoking the uTrace() function. To set the trace level to 1, you can do one of these:

Syntax

string uTrace(tracetext);

Parameters

string tracetext

Text to write to log file

Examples

Example 1

uTrace("CUSTOMER_NAME = " + CUSTOMER_NAME)



uTracelevel

Description

Sets the detail level of trace messages in the log. The range of tracelevel is from 0 (no trace) to 5 (very verbose).

Syntax

uTracelevel(tracelevel)

NoteHeavy logging slows execution dramatically.

Parameters

integer tracelevel

Specifies the verbosity of trace messages. (0 = off, 5 = very verbose)

Examples

Example 1

uTracelevel(5) // sets the tracelevel to 'very verbose'