Solved

Unhandled exception ... and continue?

Posted on 2014-04-01
2
288 Views
Last Modified: 2014-04-02
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
0
Comment
Question by:WernerVonBraun
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39968955
That event lets you display custom error messages, custom logging and the likes. But it won't let you go back automatically to the point where the error occurred.

Setting e.Handled to True does not bring you back to the point where the error occurred. It simply tells the system not to terminate the application.

It is up to you to make a call somewhere in your application so that it still goes on.
0
 
LVL 4

Author Closing Comment

by:WernerVonBraun
ID: 39972028
Yup. I realised that it exits the procedure it's currently running. That's good enough for me.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now