예제 #1
0
 public ClaseUno()
 {
     try
     {
         ClaseUno.MetodoEstatico();
     }
     catch (DivideByZeroException error)
     {
         throw new UnaException("Err 2do ctor", error);
     }
 }
예제 #2
0
 public ClaseUno(int n)
 {
     try
     {
         ClaseUno clase = new ClaseUno();
     }
     catch (UnaException err) //Tiene unaException y el division por inner
     {
         throw err;
         //throw new ClaseUno(3); UnaException("Err 2do ctor", err);
     }
 }
예제 #3
0
        static void Main(string[] args)
        {
            /*try
             * {
             * ClaseUno clase = new ClaseUno();
             * clase.MetodoInstancia();
             *
             * }
             * catch(DivideByZeroException error)
             * {
             * Console.WriteLine(error.Message);
             * }
             * catch(MiException errorMiException)
             * {
             * Console.WriteLine(errorMiException.Message);
             * Console.WriteLine(errorMiException.InnerException.Message);
             * }*/

            try
            {
                ClaseUno.MetodoInstancia();
            }
            catch (MiException miError)
            {
                Exception exceptionGeneral = miError;
                while (exceptionGeneral != null)
                {
                    Console.WriteLine(exceptionGeneral.Message);
                    exceptionGeneral = exceptionGeneral.InnerException;
                }
            }



            Console.ReadKey();
        }