Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/spelling/allow/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ commandlinetoargv
COPYFROMRESOURCE
cstdint
CXICON
CXSCREEN
CYICON
CYSCREEN
dataobject
debugbreak
delayimp
Expand Down Expand Up @@ -65,11 +67,13 @@ IAppearance
ICONINFO
IDirect
IInheritable
INPUTUNION
imm
iosfwd
isa
isspace
istream
keybd
KEYSELECT
LCID
LINEBREAK
Expand All @@ -86,6 +90,7 @@ MENUDATA
MENUINFO
MENUITEMINFOW
MINIMIZEBOX
MOUSEINPUT
MOUSELEAVE
mov
MULTIPLEUSE
Expand Down Expand Up @@ -135,6 +140,7 @@ RSHIFT
rvrn
SACL
schandle
schtasks
SEH
semver
serializer
Expand Down
2 changes: 0 additions & 2 deletions .github/actions/spelling/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ lsconfig
lstatus
lstrcmp
LTEXT
lto
ltsc
LUID
luma
Expand Down Expand Up @@ -1718,7 +1717,6 @@ titlebars
TITLEISLINKNAME
TLDP
TLEN
Tlgg
TMAE
TMPF
tmultiple
Expand Down
26 changes: 25 additions & 1 deletion src/cascadia/LocalTests_TerminalApp/CppWinrtTailored.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,31 @@ HRESULT RunOnUIThread(const TFunction& function)

auto asyncAction = d.RunAsync(winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
[&invokeResult, &function]() {
invokeResult = WEX::SafeInvoke([&]() -> bool { function(); return true; });
try
{
function();
invokeResult = S_OK;
}
catch (const winrt::hresult_error& ex)
{
invokeResult = ex.code();
WEX::Logging::Log::Comment(WEX::Common::NoThrowString().Format(
L"RunOnUIThread caught winrt::hresult_error: 0x%08x (%s)",
static_cast<unsigned int>(invokeResult),
ex.message().c_str()));
}
catch (const std::exception& ex)
{
invokeResult = E_FAIL;
WEX::Logging::Log::Comment(WEX::Common::NoThrowString().Format(
L"RunOnUIThread caught std::exception: %hs",
ex.what()));
}
catch (...)
{
invokeResult = E_UNEXPECTED;
WEX::Logging::Log::Comment(L"RunOnUIThread caught unknown exception");
}
});

asyncAction.Completed([&completedEvent](auto&&, auto&&) {
Expand Down
Loading
Loading