$procerrorcontext

Return the location of the error specified by $procerror.

$procerrorcontext

Example: message "Error occurred at %%$procerrorcontext"

Return Values

Associative list that describes the context in which the error occurred.

Associative List Items Returned by $procerrorcontext

Item

Meaning
ERROR=ErrorValue The value of $procerror
MNEM=ErrorConstant The error constant associated with the current value of $procerror
DESCRIPTION=Text A brief description of the error
COMPONENT=CompName The name of the component in which the error occurred
PROCNAME=ModuleName The name of the ProcScript module in which the error occurred, that is, the name of the entry, the operation, global ProcScript, or the Ynnn number of the trigger (as shown in the script listing)
TRIGGER=TriggerName The trigger name abbreviation where the error occurred
LINE=LineNumber The line number (as shown in the component script listing) at which the error occurred. It does not match the line number seen in the code editor because blank lines and comments are not counted.
PROCLINE=ProcScript The ProcScript command where the error occurred.
ADDITIONAL=AssociativeList An associative list containing additional information. For details, see Additional Information

Use

Allowed in all component types.

Description

The $procerrorcontext function returns an associative list that describes the context of the last validation error that occurred. In certain situations, $procerrorcontext offers additional information identified by the ID ADDITIONAL, which is itself an associative list.

If an error occurs when calling out to a web service, Uniface generates error -150 and provides details about the error in $procerrorcontext. Most of the information about the fault is provided under the ADDITIONAL ID.

Additional Information

Additional information is held under the ID ADDITIONAL, in an associative list. The contents vary depending on the command that resulted in the error:

ADDITIONAL List Items
Item Meaning
MODULENAME=ModuleName Name of the module upon which a call statement failed.
INSTANCENAME=InstanceName Name of the target instance on which a newinstance statement failed, or name of the instance containing the operation on which activate failed.
OPERATIONNAME=OperationName Name of the operation upon which an activate statement failed.
COMPONENTNAME=ComponentName Name of the target component upon which a newinstance statement failed.
COMPONENTID=ComponentID Component ID of a component upon which a newinstance statement failed due to a mismatch between unique IDs.
DESCRIPTORID=DescriptorID Descriptor ID of a component upon which a newinstance statement failed due to a mismatch between unique IDs.
Extra List Items under ADDITIONAL ID after Calls to SOAP Connector
Item Meaning
DRV=Connector Identifier of the connector in which the error occurred. For SOAP faults, it is always SOP.
LOCATION=SoapCallOutErrorLocation Stage at which the error occurred during SOAP call-out. For more information, see Information Returned for Web Services Call-Out Errors.

For each LOCATION, the error is further described using the items CODE, MESSAGE, ACTOR, and DETAIL

CODE=ErrorCode Short form the error description; mandatory.
MESSAGE=ErrorString Long form of the error description; mandatory.
ACTOR= If LOCATION=SOAPFAULT, the literal contents of the <faultactor> element , if available.

If LOCATION is CALLBACK_PRE or CALLBACK_POST, the component name and operation of the callback operation.

DETAIL= A string giving further application or processing details about the error, if available.

Extra List Items under ADDITIONAL ID after Calls to COM Call-out Connector

Item Meaning
DRV=Connector Identifier of the connector in which the error occurred. For COM call-out errors, it is always COM.
CLASS=

Type of error. For COM messages, this is always ICCDRV-COM-ERR Error with ICC system occurred. The error is further described using the items STATUS and MESSAGE

STATUS=ErrorCode ICC system error code.
MESSAGE=ErrorString Long form of the error description.

Validating Keys and Error Handling

The following example uses the $curkey function to perform specific validation for each key:

trigger validateKey

selectcase $curkey
   case 1 ;perform validation for the primary key
   ...
   case 2 ;perform validation for candidate key #2
...
   case 4 ;perform validation for candidate key #4
...
   elsecase
      message "Error %%$procerror occurred at %%$procerrorcontext"
      message "Context: %%$dataerrorcontext"
endselectcase
end; validateKey
History
Version Change
10.3.02.058 Returns ICC system error details from COM connector when errors during COM call-out.
10.3.02.045 Added PROCLINE.

Compatibility: ADDITIONAL is now the ninth item in the list instead of the eighth item. Code that used the index position rather than the ID to extract the ADDITIONAL information must be updated.

9.5.01 Returns SOAP fault information from OSAP U2.0 connector when errors occur during web services call-out.

Related Topics