Chaining exceptions
BCS
none at anon.com
Sat Nov 21 17:07:00 PST 2009
Hello Chris Nicholson-Sauls,
> BCS wrote:
>
>> That stands to reason because in some cases (when things go
>> correctly) there isn't one.
>>
> One hopes. Just the same: (hypothetical syntax incoming)
>
> try {
> // ...
> }
> catch ( ExceptionA exa ) {
> // ...
> }
> catch ( ExceptionB exb ) {
> // ...
> }
> finally ( x ) {
> // ...
> if ( x ) throw new ExceptionC( x );
> }
> And obviously if finally has no () it doesn't bother with the feature.
>
IIRC the .NET CLI has some of what you want:
http://stackoverflow.com/questions/533968/c-finally-block-that-only-runs-on-exceptions
More information about the Digitalmars-d
mailing list