title: When does a finally block execute if the catch block contains a continue statement?
body: <p>I have some code that looks like this:</p>
  
  <pre><code>foreach(var obj in collection)
  {
     try
     {
        // WriteToFile returns the name of the written file
        string filename = WriteToFile(obj); 
        SendFileToExternalAPI(filename);
     }
     catch ( ArbitraryType1Exception e )
     {
        LogError(e);
        continue;
     }
     ...
     catch ( ArbitaryTypeNException e )
     {
        LogError(e);
        continue;
     }
     finally
     {
        try
        {
           File.Delete(filename);
        }
        catch (Exception e)
        {
           LogError(e);
        }
     }
  }
  </code></pre>
  
  <p>The objective is to try and write out a temporary file for each object in the collection, attempt to load that file into an external API which wants filenames, and then clean up the temporary files when done. If an error happens when writing the file out to disk or loading it to the external API, I just want to log the error and move on to the next object; I can't ask the user what to do.</p>
  
  <p>I'm a bit uncertain of how the timing of finally blocks work when you have continue statements in the catch handlers. Is this code going to (attempt to) delete <em>the correct file</em> no matter whether an exception is thrown in the try block? Or do the continues in the catch statements take effect before the finally block runs?</p>