Solved

Unhandled exception ... and continue?

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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