Previous Topic: CreateDetectedSoftwarePatchInstanceNext Topic: CloseDetectedSoftwareOutputFiles


LogDetectedSoftwareError

The LogDetectedSoftwareError function writes error messages to an error log file. The function produces localizable error messages. Call this function for handling errors generated by create functions. The engine reads these error messages and displays in DSM Explorer.

Function format:

LogDetectedSoftwareError (MessageID as String, Properties as String)

Example:

LogDetectedSoftwareError("ISE:00400","PARAM5=Microsoft Windows 7 Ultimate x64 64 en-us|PARAM6=VersionNumber=6.1.7600 |VersionLabel=6.1.7600 |Language=en-us |Bitness=64 |Architecture=x64 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Product|PARAM7=SWDETECT_BADARGS");

The preceding example code adds the following message to the log file:

Intellisig Microsoft Windows 7 version 6.1.7600, UUID A7C1E14A-7C93-4E17-B4E5-45B796717F49, script win7.xml, Failed to create software product. The parameters were ProductName:Microsoft Windows 7 Ultimate x64 64 en-us OptionalProperties : VersionNumber=6.1.7600 |VersionLabel=6.1.7600 |Language=en-us |Bitness=64 |Architecture=x64 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Product. Return Code : SWDETECT_BADARGS

Input Parameters

This function has the following input parameters:

MessageID

Specifies the error code. For more information about available error codes, see Error Codes and Optional Properties.

Properties

Specifies a list of properties that are required to create a formatted message string. Specify the parameters passed to the respective create functions that you are handling. The parameters must match the error text. For the exact error text and function syntax, see Error Codes and Optional Properties. The error text uses PARAM1 to PARAM8 to create the message string. If the string does not contain param, value pairs, the string is displayed as is. The parameters PARAM1 to PARAM4 are automatically assigned to the following values:

The values for parameters PARAM5 to PARAM8 differ depending on the create function you are handling. For example, if you are handling the failure of the CreateDetectedSoftwareProduct function, following are the error code and text:

Error code: ISE:00400

Error text: Intellisig %1$t version %2$t, UUID %3$t, script %4$t, Failed to create software product. The parameters were ProductName:%5$t OptionalProperties: %6$t. Return Code: %7$t

In this example, PARAM5 specifies the product name, PARAM6 specifies optional properties, and PARAM7 specifies the return code.