DIAdem Help

Method: LogError for ContextInitialize <Analysis Automation>

  • Updated2024-09-12
  • 1 minute(s) read

Method: LogError for ContextInitialize <Analysis Automation>

Creates an error. The analysis automation continues the script but marks the file in the analysis automation as failed.

Object.LogError(message)
ObjectContextInitialize <Analysis Automation>
Object with this method
messageString
Specifies the error text.

The following example marks the processed file as defective when the parameter for the result path is missing:

VBScriptPython

 

Sub On_Initialize(oContext)
  Dim ResultsPath, oMyArguments
  Set oMyArguments = oContext.Procedure.Arguments
  If oMyArguments.Exists("ResultsPath") Then
    ResultsPath = oMyArguments.Item("ResultsPath").Value
    Call oContext.LogResult("Results path: " & ResultsPath)
  Else
    Call oContext.LogError("Resultpath missing")
  End If
End Sub