private static void RethrowException() { try { ExceptionTests.Throw(); } catch (ArgumentNullException) { throw; } }
public static void PrintRethrownWithReference() { try { ExceptionTests.RethrowExceptionWithReference(); } catch (ArgumentNullException e) { e.Print(); } }
public static async Task ThrowAndAwait() { try { ExceptionTests.RethrowExceptionWithReference(); } catch (ArgumentNullException) { await ExceptionTests.RunAsync(); } }
public static void CreateThrowAndPrint() { try { ExceptionTests.Throw(); } catch (ArgumentNullException e) { e.Print(); } }
private static void RethrowExceptionWithReference() { try { ExceptionTests.Throw(); } catch (ArgumentNullException e) { throw e; } }
public static void CreateThrowAndPrintWithInner() { try { try { ExceptionTests.Throw(); } catch (ArgumentNullException e) { throw new InvalidNameException("Custom", e); } } catch (InvalidNameException e) { e.Print(); } }
public static void CreateAndPrint() => ExceptionTests.Create("args").Print();
private static void Throw() => throw ExceptionTests.Create("args");