Solved

Unhandled exception ... and continue?

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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…

777 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