Editare

Partajați prin


ExceptionDispatchInfo Class

Definition

Represents an exception whose state is captured at a certain point in code.

public ref class ExceptionDispatchInfo sealed
public sealed class ExceptionDispatchInfo
type ExceptionDispatchInfo = class
Public NotInheritable Class ExceptionDispatchInfo
Inheritance
ExceptionDispatchInfo

Remarks

An ExceptionDispatchInfo object stores the stack trace information and Watson information that an exception contains at the point where it's captured. The exception can then be thrown at another time and possibly on another thread by calling the ExceptionDispatchInfo.Throw method. The exception is thrown as if it had flowed from the point where it was captured to the point where the Throw method is called.

For an example, see Capture exceptions to rethrow later.

ExceptionDispatchInfo cannot be serialized and is not intended to cross application domain boundaries.

Properties

SourceException

Gets the exception that's represented by the current instance.

Methods

Capture(Exception)

Creates an ExceptionDispatchInfo object that represents the specified exception at the current point in code.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetCurrentStackTrace(Exception)

Stores the current stack trace into the specified Exception instance.

SetRemoteStackTrace(Exception, String)

Stores the provided stack trace into the specified Exception instance.

Throw()

Throws the exception that's represented by the current ExceptionDispatchInfo object, after restoring the state that was saved when the exception was captured.

Throw(Exception)

Throws the source exception, maintaining the original Watson information and augmenting rather than replacing the original stack trace.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also