When activated, LogError creates an entry in the action Log of the type User Error, as illustrated in this Log snippet below.

image-20240109-220317.png

Further code in this script will execute but the mapping will stop after this event, and a LogError will result in a PINK log with a failed status.

By using LogError you are indicating to the user that an error has occurred that cannot be recovered from automatically, and therefore the user needs to step in.

The message that is logged should be as precise as possible and provide enough information for the user to fix the problem and re-run the action.

Declaration: procedure LogError(aMesg : string);

A simple example follows.

procedure OnMapEvent(var Value:Variant);
begin
if MyData.EOF then
LogError('You are at the end of records in MyData recordset.');
end;

Please also refer to Exception Functions and Try....Except for additional information regards error logging.