[System] Tweak socket test
[mono-project.git] / mono / tests / exception9.cs
blob79f29fe9d09971f2537327af585b99464136480a
1 using System;
3 public class FinallyTest {
4 public static void MyHandler(object sender,
5 UnhandledExceptionEventArgs args) {
7 Console.WriteLine("UnhandledExceptionEventHandler called");
10 public static void Main() {
11 Console.WriteLine("Top level block");
13 AppDomain domain = AppDomain.CurrentDomain;
14 domain.UnhandledException +=
15 new UnhandledExceptionEventHandler(MyHandler);
17 try {
18 Console.WriteLine("First try block");
19 try {
20 Console.WriteLine("Second try block");
21 throw new Exception();
22 } finally {
23 Console.WriteLine("Second finally block");
25 } finally {
26 Console.WriteLine("First finally block");
29 Console.WriteLine("Back to top level block");