Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>If an exception is thrown during execution of a finally block, and an exception was already being propagated, that exception is lost</p> </blockquote> <p>Basically, what's happening when you execute:</p> <ul> <li><code>CryptographicException</code> is thrown in inner finally.</li> <li>Outer-scope finally executes, and throws <code>ArgumentException</code>. Since "CryptographicException" was "being propogated" at this point in time, it is lost.</li> <li>Final catches occur, and <code>ArgumentException</code> is caught.</li> </ul> <blockquote> <p>... and it wouldn't make sense for the first exception to simply disappear into the ether, just because there was another exception thrown from a different finally block.</p> </blockquote> <p>This is exactly what happens, based on the C# language specification you quoted. The first exception (<code>CryptographicException</code>) effectively disappears - it's "lost". </p> <p>You can only reach this state by explicitly using <code>finally</code>, though, so I believe the assumption is that you're providing the error handling with this expectation or possibility in mind (as you're using <code>try</code> at that point, which means you've accepted you may have an exception).</p> <p>This is basically explained in detail in the spec in <code>8.9.5</code> (the text in <code>8.10</code> you quoted refers to this section):</p> <blockquote> <p>If the finally block throws another exception, processing of the current exception is terminated. </p> </blockquote> <p>The first exception, in your case the <code>ArgumentException</code>, basically "disappears".</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload