WinRTWebSocketResource throws on Windows API errors
Exceptions are thrown, which always show in the debugger even if they are ultimately caught and managed.
Leverage the DEFAULT_CPPWINRT_EXCEPTIONS to make the Windows-provided WinRT APIs return a winrt::hresult value instead of throwing.
this might be a little too big of a change; e.g. we already have code that does try/catch, so we'd have to propagate the change to make the return value of everything hresult to pretty much everything.
Instead we could file a feature request on the WinRTWebSocketResource API in ADO, to be quieter?
@asklar It's not a big change.
The exceptions are already caught within the interface IWebSocketResource boundary.
The issue is, they still show up in a debuggint sessions before being handled by the catch block.
@acoates-ms suggests to use a different approach and have those Windows APIs return an hresult instead.
For future reference, the only error propagation mechanism of IWebSocketResource is whichever handler you define in SetOnError.
Also, we want to make this interfaces' methods noexcept, but we ran into issues when the implementing class was based on boost. I'll revisit this topic soon.
@acoates-ms says that UWP implementation is already doing this, so the Desktop implementation should match.
This was already approved for 62 and I'm approving for 63 as well