When you make an Assumption of function and it it violates the assumption ,then you might probably need to throw an exception. For instance,Let’s assume that we have function which returns true if the length of List is greater than 50 and false if it is less than 50.Now what if the list is Null?(function Doe not have assumption ) ,this creates the necessary to throw exception
//This functions assume that you past list item filled with inetgers. //It is not assumed that list might be null,so here you need to throw exception private static bool ValidateListLength(List<int>l) { try { return l.Count>50; } catch { throw ; } return false; }