Share via


ICorDebugThread::GetCurrentException Method

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

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

Parameters

  • ppExceptionObject
    [out] A pointer to the address of an ICorDebugValue object that represents the exception that is 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 function evaluation, which is performed by the ICorDebugEval methods, will clear out the exception object on setup and restore it on completion.

Exceptions can be nested (for example, if an exception is thrown in a filter or in a function evaluation), 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, after an exception of type x is thrown, the common language runtime (CLR) may run out of memory and promote it 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

Concepts

ICorDebugThread Interface

ICorDebugThread2 Interface