Ejemplo n.º 1
0
 private static void RethrowException()
 {
     try
     {
         ExceptionTests.Throw();
     }
     catch (ArgumentNullException)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 public static void PrintRethrownWithReference()
 {
     try
     {
         ExceptionTests.RethrowExceptionWithReference();
     }
     catch (ArgumentNullException e)
     {
         e.Print();
     }
 }
Ejemplo n.º 3
0
 public static async Task ThrowAndAwait()
 {
     try
     {
         ExceptionTests.RethrowExceptionWithReference();
     }
     catch (ArgumentNullException)
     {
         await ExceptionTests.RunAsync();
     }
 }
Ejemplo n.º 4
0
 public static void CreateThrowAndPrint()
 {
     try
     {
         ExceptionTests.Throw();
     }
     catch (ArgumentNullException e)
     {
         e.Print();
     }
 }
Ejemplo n.º 5
0
 private static void RethrowExceptionWithReference()
 {
     try
     {
         ExceptionTests.Throw();
     }
     catch (ArgumentNullException e)
     {
         throw e;
     }
 }
Ejemplo n.º 6
0
 public static void CreateThrowAndPrintWithInner()
 {
     try
     {
         try
         {
             ExceptionTests.Throw();
         }
         catch (ArgumentNullException e)
         {
             throw new InvalidNameException("Custom", e);
         }
     }
     catch (InvalidNameException e)
     {
         e.Print();
     }
 }
Ejemplo n.º 7
0
 public static void CreateAndPrint() => ExceptionTests.Create("args").Print();
Ejemplo n.º 8
0
 private static void Throw() => throw ExceptionTests.Create("args");