Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Car myCar = new Car("Rusty", 90);

            try
            {
                myCar.Accelerate(50);
            }
            catch (CarIsDeadException ex)
            {
                Console.WriteLine(ex.Message);
                //Console.WriteLine(ex.ErrorTimeStamp);
                //Console.WriteLine(ex.CauseOfError);
            }

            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("**** Fun with Custom Exceptions ****\n");
            Car myCar = new Car("Rusty", 90);

            try
            {
                myCar.Accelerate(50);
            }
            catch (CarIsDeadException e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.ErrorTimeStamp);
                Console.WriteLine(e.CauseOfError);
            }

            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("***** Fun with Custom Exceptions ******\n");
            Car myCar = new Car("Rusty", 90);

            try
            {
                myCar.Accelerate(50);
            }
            catch (CarIsDeadException e)
            {
                Console.WriteLine(e.Message);



                Console.WriteLine(e.ErrorTimeStamp);



                Console.WriteLine(e.CauseOfError);
            }
            Console.ReadLine();
        }