Error handling

Function

Description

uError

Writes an error text into a log and signals an error

uErrortext

Returns the last error message

uWarning

Writes a warning message into a log

uInfo

Writes an informal message into a log

uTrace

Writes a trace message into a log

uTracelevel

Sets the detail level of trace messages in the a log




uError

Description

Writes an error text into a 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 a 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 a 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 a log.

You must manually set the trace level to at least 1before invoking the uTrace() function. To set the trace level to 1, 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)

NoteVerbose message tracing may dramatically reduce performance.

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'