[Mono-list] exception semantics

Jeroen Frijters mono@jeroen.nu
Tue, 29 Jan 2002 12:22:19 +0100


This is the correct behaviour, since you explicitly return from the
catch block.

Regards,
Jeroen

> -----Original Message-----
> From: mono-list-admin@ximian.com 
> [mailto:mono-list-admin@ximian.com] On Behalf Of Morten Sylvest Olsen
> Sent: Monday, January 28, 2002 21:49
> To: mono-list@ximian.com
> Subject: [Mono-list] exception semantics
> 
> 
> Hi..
> 
> Whats the current state of the interpreter?
> 
> I tried to run the following code (compiled with ms csc.exe):
> 
> ...
> try {
> 	Console.WriteLine("In try");
> 	throw new Exception();
> 	//return(1);
> }
> catch (Exception e) {
> 	Console.WriteLine("In catch");
> 	return(2);
> }
> finally {
> 	Console.WriteLine("In finally");
> }
> 
> and got:
> 
> In try
> In catch
> 
> No execution of the finally block happens.
> 
> Whats the concensus on the exception semantics? I was 
> discussed back in
> August, but I couldn't glean any conclusion whether a finally block is
> supposed to be executed before or after the exception handler.
> 
> - Morten
> 
> Novinson's Revolutionary Discovery:
> 	When comes the revolution, things will be different --
> 	not better, just different.
> ----------------------------------------------------------
> email: morten@bergsoe.k-net.dk,c958496@student.dtu.dk
> addresse: Bergsøe Kollegiet v. 1105 2850 Nærum
> ----------------------------------------------------------
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>