Re: Try .. Catch with no Exception needed.

Tech-Archive recommends: Fix windows errors by optimizing your registry



Nicholas Paldino [.NET/C# MVP] wrote:
It should be noted that if you catch an Exception (or just have a catch statement) that your application won't necessarily be "stable". In catching all exceptions (instead of just ones you know are going to be thrown) you are corrupting your application state to some degree, and if you aren't fastidious about defining the boundaries of your application, you will have unexpected errors because of exceptions that were thrown and ignored in other areas.

In other words, be very careful about proceeding in this manner. There are reasons that exceptions are thrown, and you should ignore them at your own peril.



For some reason an image of an old map popped into my head containing "Here there be dragons!" :)

--
Lasse Vågsæther Karlsen
mailto:lasse@xxxxxxxxxxx
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
.



Relevant Pages

  • Re: Reflection problem
    ... I'm pretty sure that there are no exceptions being thrown while ... >> Incoming mail is certified Virus Free. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Configuration Error Not Helpful
    ... >What kind of error in the configuration section causes the exception to be ... schema validation, and any error that gets thrown from that gets this ... those exceptions never got displayed. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sending over DO seems to make main process block?
    ... DO is one of the few places in Cocoa where exceptions are thrown that ... an exception may be thrown when the ... avoid deadlock. ... the sender expects to be called back from the receiver, ...
    (comp.sys.mac.programmer.help)
  • Re: How much processor resources do try-catch blocks in C# use
    ... You are right...if no exceptions are thrown, ... Marc Butenko ... > I was discussing with someone how much processor resources try-catch ...
    (microsoft.public.vsnet.general)
  • Re: throw in a finally
    ... > other well-documented texts available that point out this problem. ... > that the reasons behind it are the same as the reasons behind why ... Catch exceptions thrown in a finally even if the method declares they are ... Catch exceptions and just log them. ...
    (comp.lang.java.programmer)