Re: try finally Error Handling without catch



A.M-SG <alanalan@xxxxxxxxxxxxxxxx> wrote:
> I underestand that we can use try finally without catch clause. Something
> like this:
> try
> {
> throw new Exception("Test")
> }
> finally
> {
> // close all files
> }
>
> What exactly is this?

It means that the finally block is executed whatever happens, but any
exceptions thrown in the try block are still propagated up the stack
(rather than being caught).

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: Raise event inside a thread
    ... using monitors or a ManualResetEvent. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: get the actual size of a file
    ... saying for certain either way:) ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Threading/Locking
    ... Then you stash the data in an ordered list which is then processed by ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to trigger other thread
    ... updates are "seen" or not. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: MemoryStream.Write() Offset cannot be zero
    ... a file - it's just like that, except it all stays in memory. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.framework)