CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Exception message thrown by WinRT object is not preserved by C#/WinRT

Open llongley opened this issue 4 years ago • 1 comments

Click the button in these two repro apps to see the issue:

ColorPickerExceptionMessageUWP.zip

ColorPickerExceptionMessageDesktop.zip

In the UWP application, which does not use C#/WinRT projections, setting ColorPicker.MaxHue to an invalid value causes an ArgumentException to be thrown that gives the specific information that the value must be between 0 and 359. In the desktop application, which does use C#/WinRT projections, the ArgumentException is still thrown, but the specific error message is lost - all we get is the default ArgumentException error message.

llongley avatar Sep 23 '20 01:09 llongley

Issue looks to be we store the restricted error info message in the data dictionary and not actually use it for the message. Looking for a way to set it.

manodasanW avatar Jul 28 '21 03:07 manodasanW

fixed by #1228 App.UnhandledException fix will be available in Windows App SDK 1.2 Preview 2

Scottj1s avatar Sep 06 '22 19:09 Scottj1s