Re: Exception management question...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 01/20/05


Date: Thu, 20 Jan 2005 16:59:05 -0600

Craig,
> 1) What is a launcher?
A launcher is a small program that loads your program & runs it. Useful for
(but not limited to) apps that dynamically update themselves from a web
site, but run locally. The launcher downloads the required assemblies & runs
them locally... The launcher itself may be installed locally, so as to allow
any required permissions needed...

> 2) What do you mean by an exception being swallowed?
A try/catch or Global Exception Handler caught an exception & never let
other routines that called it or the user know. Depending on the calling &
called routines, this can be either a good thing or bad thing.

In the case of Global Exception Handlers, this can prevent your app from
terminating unexpectedly.

> Are the two of you suggesting that unhandled exceptions should be allowed
> to propagate up to a global exception handler which logs the exception and
> closes down the app?
If all I am doing with the exception is logging it, I am suggesting that
normally I allow a global exception handler log it (mainly to avoid
duplicate try/catch log blocks). If I have other "recovery" that is needed
to occur, then I use a try/catch block to perform the recovery. Depending on
where & what this recovery is I either log the exception, not log the
exception, rethrow the exception, or throw a new exception. Note that global
exception handlers really don't "recover" from exceptions, they can log the
exception & at a high level decide if the app should terminate or keep
going...

Hope this helps
Jay

"craig" <e@mail.com> wrote in message
news:%23tpPbUy$EHA.3256@TK2MSFTNGP11.phx.gbl...
>2 questions:
>
> 1) What is a launcher?
>
> 2) What do you mean by an exception being swallowed?
>
> My app is a windows forms app and I am really struggling to find a
> consistent, logical strategy for implementing exception management. Looks
> like I am going to have to invest some time studying the info in this
> thread.
>
> Are the two of you suggesting that unhandled exceptions should be allowed
> to propagate up to a global exception handler which logs the exception and
> closes down the app? This would mean that the following code should never
> be used:
>
> try
> {
> //program logic
> }
> catch(Exception ex)
> {
> //response to exception
> }
>
> I have used code like this all over in my app.
>
>
<<snip>>



Relevant Pages

  • Re: Application xxx has encountered a serious error and must shut
    ... Chris Tacke, Embedded MVP ... use of Queueacross multiple threads - and even my exception ... stopped my Serial port thread - last time it stopped the whole app:-O. ... NB I replaced the MS SerialPort with OpenNetCF Serial and this seems ...
    (microsoft.public.windowsce.app.development)
  • Re: Exception management question...
    ... There is code in my app that follows this general pattern: ... This allows an exception to be thrown with the next line of code attempts to ... >> to propagate up to a global exception handler which logs the exception ... > has determined that the app should terminate the UE handler has no means ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SqlceException.SqlceException
    ... First of all, i found the cause of the exception and corrected it, it was ... > same challenge in terms of deploying the initial SQL CE database. ... > db along with your app. ... it is the first time i am doing mobile applications and the first ...
    (microsoft.public.sqlserver.ce)
  • Re: wtf?
    ... > called by the ASP classic app, ... >> other than error translation. ... > exception that comes from the command's execute method doesn't seem to ... > the time we might be content saying "SqlException", in this case, we ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: strong key problems
    ... it is not clear what you are actually trying to accomplish by somehow ... i - how to create a strong key and use it in your applications. ... iv - any referencer to any app with strong name must also have a strong ... Unhandled Exception: System.Security.SecurityException: That assembly ...
    (microsoft.public.dotnet.languages.csharp)