อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


TrackingWorkflowExceptionEventArgs.OriginalActivityPath Property

Definition

Gets the QualifiedName of the activity that originally threw the exception.

C#
public string OriginalActivityPath { get; }

Property Value

The QualifiedName of the activity that originally threw the exception.

Examples

The following code example demonstrates a method, named WriteExceptionEventArgs, which captures a TrackingWorkflowExceptionEventArgs. The code checks whether the Exception property is null (Nothing in Visual Basic). If it is not, the code writes the message associated with the Exception property to the console. If Exception is null (Nothing), the code converts the value of the OriginalActivityPath property to a string and writes it to the console.

This code example is part of the EventArgs Tracking SDK Sample from the Program.cs file. For more information, see EventArgs Tracking Sample.

C#
static void WriteExceptionEventArgs(string eventDescription, TrackingWorkflowExceptionEventArgs exceptionEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nException Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != exceptionEventArgs.Exception)
    {
        Console.WriteLine("ExceptionEventArgs Exception Message: " + exceptionEventArgs.Exception.Message.ToString());
    }
    Console.WriteLine("ExceptionEventArgs Original Activity Path: " + exceptionEventArgs.OriginalActivityPath.ToString());
}

Remarks

Exceptions are passed up the chain of exception handler activities. An exception handler may choose to throw an exception again. When an exception handler throws an exception again, a new exception tracking event containing a new TrackingWorkflowExceptionEventArgs is raised to the runtime tracking infrastructure. OriginalActivityPath refers to the activity that originally threw the exception.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also