Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Last active November 7, 2023 17:54
Show Gist options
  • Save kennykerr/b765f06295622c92a1352e9deb221f5d to your computer and use it in GitHub Desktop.
Save kennykerr/b765f06295622c92a1352e9deb221f5d to your computer and use it in GitHub Desktop.
#include "pch.h"
using namespace winrt;
using namespace Windows::Foundation;
IAsyncAction Sample()
{
throw winrt::hresult_invalid_argument(L"yolo");
}
int main()
{
try
{
Sample().get();
}
catch (winrt::hresult_error const& e)
{
assert(e.message() == L"yolo");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment