다음을 통해 공유


ICorDebugThread::GetCurrentException Method

Gets an interface pointer to an ICorDebugValue Interface that represents an exception object currently being thrown by managed code.

HRESULT GetCurrentException (
    [out] ICorDebugValue **ppExceptionObject
);

Parameters

Parameter Description

ppExceptionObject

[out] A pointer to the address of an ICorDebugValue Interface object that represents the exception currently being thrown by managed code.

Remarks

The exception object will exist from the time the exception is thrown until the end of the catch block. A func-eval (function evaluation), which is performed by the ICorDebugEval Interface methods, will clear out the exception object on setup and restore it on completion. Exceptions can be nested (e.g., if an exception is thrown in a filter or a func-eval), so there may be multiple outstanding exceptions on a single thread.

GetCurrentException returns the most current exception. The exception object and type may change throughout the life of the exception. For example, an exception of type X may be thrown, but then the common language runtime (CLR) may run out of memory and promote that to an out-of-memory exception.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: CorDebug.idl

Library: CorGuids.lib

.NET Framework Version: 2.0, 1.1, 1.0

See Also

Reference

ICorDebugThread Interface
ICorDebugThread2 Interface