Re: Exception management question...
From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 01/20/05
- Next message: C.E.O. Gargantua: "Re: Adding member property to abstract class"
- Previous message: David Levine: "Re: Exception management question..."
- In reply to: craig: "Re: Exception management question..."
- Next in thread: craig: "Re: Exception management question..."
- Messages sorted by: [ date ] [ thread ]
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>>
- Next message: C.E.O. Gargantua: "Re: Adding member property to abstract class"
- Previous message: David Levine: "Re: Exception management question..."
- In reply to: craig: "Re: Exception management question..."
- Next in thread: craig: "Re: Exception management question..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|