dic_Message = New Dictionary(Of String, Object) From {
{"Code", "A002"},
{"Level", "Error"},
{"Message", "異常終了:UiPath.Presentations.Activitiesファイルのパスが無効です。"}
}
Throw New BusinessRuleException("Your message") With {.Data = dic_Message}
Logging the exception Data in Catch block:
Try
' Your logic here
Catch ex As BusinessRuleException
If ex.Data.ContainsKey("Code") Then
LogMessage("異常発生: " + ex.Data("Code").ToString())
End If
End Try
To concatenate additional strings before and after the dic_Message(exception.Data("Code").ToString) in the LogMessage activity, you can do the following: