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