private void CheckCat(Cat testCat) { if (testCat.Age <= 0) { // create a custom exception instance CustomCatException e = new CustomCatException("Your cat is too young."); e.HelpLink = "http://www.libertyassociates.com"; throw e; } }
private void CatManager(Cat kitty) { CheckCat(kitty); Console.WriteLine("Managing a cat who is " + kitty.Age + " years old"); }