Link to home
Start Free TrialLog in
Avatar of Member_2_1348041
Member_2_1348041Flag for Ireland

asked on

Unhandled exception ... and continue?

I added Application_DispatcherUnhandledException to my code, and it's working nicely. I put "divide by zero" error in my application, ran it, and lo and behold the code in this method was executed.

So far so good, but ... I added a "CanContinueAfterError" property to my Application, which can be set to either False or True. You catch my drift. If it's False, the Application_DispatcherUnhandledException should log the error and exit gracefully. And it does. Happy days.

But when I set the property to True, it should show a slightly different message, set e.Handled to True, and then continue .... ?

Well, I set e.Handled to True, I can step through it going to the end of the Sub, but after that, nothing. It doesn't return to the code that triggered the error, nothin'.

What am I doing wrong?

Suggestions preferably in VB.NET

Cheers

P
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_1348041

ASKER

Yup. I realised that it exits the procedure it's currently running. That's good enough for me.