ICorDebugThread::GetCurrentException Method

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
);

ppExceptionObject

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

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.

Platforms: See .NET Framework System Requirements.

Header: CorDebug.idl

Library: CorGuids.lib

.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2016 Microsoft