Skip to content

Commit

Permalink
Remove WUX exception types downlevel
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Aug 6, 2024
1 parent 76d2e8e commit 73fcb04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/WinRT.Runtime/ExceptionHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,41 +225,49 @@ private static Exception GetExceptionForHR(int hr, bool useGlobalErrorState, out
ex = !string.IsNullOrEmpty(errorMessage) ? new InvalidOperationException(errorMessage) : new InvalidOperationException();
break;
case E_XAMLPARSEFAILED:
#if NET
if (FeatureSwitches.UseWindowsUIXamlProjections)
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Windows.UI.Xaml.Markup.XamlParseException(errorMessage) : new Windows.UI.Xaml.Markup.XamlParseException();
}
else
#endif
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Microsoft.UI.Xaml.Markup.XamlParseException(errorMessage) : new Microsoft.UI.Xaml.Markup.XamlParseException();
}
break;
case E_LAYOUTCYCLE:
#if NET
if (FeatureSwitches.UseWindowsUIXamlProjections)
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Windows.UI.Xaml.LayoutCycleException(errorMessage) : new Windows.UI.Xaml.LayoutCycleException();
}
else
#endif
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Microsoft.UI.Xaml.LayoutCycleException(errorMessage) : new Microsoft.UI.Xaml.LayoutCycleException();
}
break;
case E_ELEMENTNOTAVAILABLE:
#if NET
if (FeatureSwitches.UseWindowsUIXamlProjections)
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Windows.UI.Xaml.Automation.ElementNotAvailableException(errorMessage) : new Windows.UI.Xaml.Automation.ElementNotAvailableException();
}
else
#endif
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Microsoft.UI.Xaml.Automation.ElementNotAvailableException(errorMessage) : new Microsoft.UI.Xaml.Automation.ElementNotAvailableException();
}
break;
case E_ELEMENTNOTENABLED:
#if NET
if (FeatureSwitches.UseWindowsUIXamlProjections)
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Windows.UI.Xaml.Automation.ElementNotEnabledException(errorMessage) : new Windows.UI.Xaml.Automation.ElementNotEnabledException();
}
else
#endif
{
ex = !string.IsNullOrEmpty(errorMessage) ? new Microsoft.UI.Xaml.Automation.ElementNotEnabledException(errorMessage) : new Microsoft.UI.Xaml.Automation.ElementNotEnabledException();
}
Expand Down

0 comments on commit 73fcb04

Please sign in to comment.