예제 #1
0
        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();
        }
예제 #2
0
        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();
        }