Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- public static class Program
- {
- public static void Main()
- {
- AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
- FailInThread();
- }
- private static void FailInThread()
- {
- ParameterizedThreadStart start = _ => { throw new Exception(); };
- Thread thread = new Thread(start);
- thread.Start();
- thread.Join();
- }
- private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
- {
- Console.WriteLine("Caught {0}", e.ExceptionObject.GetType());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement