static void Main() { ClassWithException instance = new ClassWithException(); //instance.CatchInner(); // Попробовать вызвать. try { instance.CatchInner(); } catch (Exception exception) { Console.WriteLine("Exception caught: {0}", exception.Message); Console.WriteLine("Inner Exception : {0}", exception.InnerException.Message); } // Delay. Console.ReadKey(); }
static void Main() { Console.OutputEncoding = Encoding.UTF8; ClassWithException instance = new ClassWithException(); //instance.CatchInner (); // Спробувати викликати. try { instance.CatchInner(); } catch (Exception exception) { Console.WriteLine("Exception caught: {0}", exception.Message); Console.WriteLine("Inner Exception: {0}", exception.InnerException.Message); } // Delay. Console.ReadKey(); }