<p>In the <code>IDisposable.Dispose</code> method is there a way to figure out if an exception is being thrown?</p>

<pre><code>using (MyWrapper wrapper = new MyWrapper())
{
    throw new Exception("Bad error.");
}
</code></pre>

<p>If an exception is thrown in the <code>using</code> statement I want to know about it when the <code>IDisposable</code> object is disposed.</p>

Instead of the syntactic sugar of the using statement, why not just implement your own logic for this.  Something like:
```
```
try
{
  MyWrapper wrapper = new MyWrapper();

}
catch (Exception e)
{
  wrapper.CaughtException = true;
}
finally
{
   if (wrapper != null)
   {
      wrapper.Dispose();
   }
}
```
```