I am rather new to exceptions. In a part of my program if a specific variable goes beyond a certain value I want to manually throw an exception which will say that the variable has gone outside of accepted range. The variable being 16 bits can still hold the "invalid" values but under normal program operation it will only hold a subset of the possible values it can hold.
How do I generate this specific type of exception?