Re: throw in a finally
From: VisionSet (spam_at_ntlworld.com)
Date: 08/13/04
- Next message: Omar Khan: "Re: File type recognition"
- Previous message: Michael Borgwardt: "Re: unreachable statements"
- In reply to: Tony Morris: "Re: throw in a finally"
- Next in thread: Sudsy: "Re: throw in a finally"
- Reply: Sudsy: "Re: throw in a finally"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 13 Aug 2004 16:22:27 GMT
"Tony Morris" <not@telling.you> wrote in message
news:Ux0Tc.54958$K53.41705@news-server.bigpond.net.au...
> Any explanation I give is going to be redundant with any and all of the
> other well-documented texts available that point out this problem.
> Suffice to say that your tool is correct (it is a high severity defect)
and
> that the reasons behind it are the same as the reasons behind why
explicitly
> returning from a throws clause is a bad thing to do.
>
> As a general rule, "Never throw or return from within a finally clause -
the
> consequences of this are ... <well-documented/>".
Are we saying:
Don't throw in a finally.
Catch exceptions thrown in a finally even if the method declares they are
thrown
Catch exceptions and just log them.
Take the view that the finally is a bonus, if there was an exception in the
try, then that is the important one, that is what the user may get to see.
I guess you just can't have two separate exeception stacks thrown.
-- Mike W
- Next message: Omar Khan: "Re: File type recognition"
- Previous message: Michael Borgwardt: "Re: unreachable statements"
- In reply to: Tony Morris: "Re: throw in a finally"
- Next in thread: Sudsy: "Re: throw in a finally"
- Reply: Sudsy: "Re: throw in a finally"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|