Solved

Unhandled exception ... and continue?

Posted on 2014-04-01
2
286 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

17 Experts available now in Live!

Get 1:1 Help Now