1.  
  2. class CustomException : Exception
  3. {
  4. public CustomException(string message)
  5. {
  6. }
  7.  
  8. }
  9. private static void TestThrow()
  10. {
  11. CustomException ex =
  12. new CustomException("Custom exception in TestThrow()");
  13.  
  14. throw ex;
  15. }
  16.