-
Notifications
You must be signed in to change notification settings - Fork 265
Description
Today in C++/WinRT, any application-type exceptions that aren't one of the known exception types get lost at the ABI boundary in to_hresult(). Additionally, even if the exception is a known type (such as a user-derived type of std::exception) any information other than the message is lost when translating for the ABI layer.
The WinRT ABI supports passing around a (wrapped) language-projection-specific exception object that can be restored and re-thrown once the code re-enters the C++/WinRT projection. With the std::exception_ptr type and the related functions, the language projection can preserve exceptions transparently across the ABI boundary.
The .NET projections use this feature to preserve .NET Exceptions across the ABI boundary. They also support preserving other projection's language exceptions through the .NET projection surface so the exceptions will be correctly handled even if the .NET code doesn't catch them.