[Mono-list] exceptions and ECMA issues

Nick Drochak ndrochak@gol.com
Wed, 22 Aug 2001 07:35:24 +0900


On Tue, 21 Aug 2001, Paolo Molaro wrote:

> 2) rethrow opcode. It is not clear where the search for an handler
> should begin after a rethrow: should it start from the beginning,
> from the last handler found or from the parent method?
> Consider:
>
-- snip code example --
>
> Restarting from the beginning will result in an infinite loop,
> so, what other option should I choose?

From the C# Language Spec (sec 8.9.5 The throw statement):
"When an exception is thrown, control is transferred to the first catch
clause in an enclosing try statement that can handle the exception. "

The operative word being "enclosing." Control shouldn't transfer to any
catch block in the same try, it should always propagate outwards.

There is a excruciatingly detailed process description of exeception
propagation in section 8.9.5 of the spec.  Perhaps that would help?

HTH,
Nick