Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get the correct type of exception #1192

Open
Daoting opened this issue May 11, 2022 · 2 comments
Open

Unable to get the correct type of exception #1192

Daoting opened this issue May 11, 2022 · 2 comments

Comments

@Daoting
Copy link

Daoting commented May 11, 2022

Describe the bug

When a custom exception is triggered, the correct exception type cannot be obtained in the unhandled exception event.

Steps to reproduce the bug

Attach the UnhandledException event

       public App()
        {
            this.InitializeComponent();
            UnhandledException += OnUnhandledException;
        }

        private void OnUnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
        {

        }

Throws a custom exception

    public sealed partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
        }

        private void myButton_Click(object sender, RoutedEventArgs e)
        {
            throw new KnownException("LOB Warning");
        }
    }

    public class KnownException : Exception
    {
        public KnownException(string p_message)
            : base(p_message)
        {
        }
    }

Unable to get the correct type of exception

image

Expected behavior

No response

Screenshots

No response

NuGet package version

1.0.0

Packaging type

Packaged (MSIX)

Windows version

No response

IDE

Visual Studio 2022-preview

Additional context

No response

@btueffers btueffers transferred this issue from microsoft/WindowsAppSDK May 12, 2022
@Daoting
Copy link
Author

Daoting commented Aug 5, 2022

Please check if it is a bug.

@Gabboxl
Copy link

Gabboxl commented May 7, 2023

I'm facing the same issue. Will this bug ever be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants