ExceptionDispatchInfo.SetCurrentStackTrace(Exception) Method

Definition

Stores the current stack trace into the specified Exception instance.

C#
public static Exception SetCurrentStackTrace(Exception source);

Parameters

source
Exception

The unthrown exception.

Returns

The source exception instance with the stack trace included.

Exceptions

The source argument was null.

The source argument was previously thrown or previously had a stack trace stored into it.

Applies to

Производ Верзије
.NET 5, 6, 7, 8, 9, 10