Replace Exception with test
From CSSEMediaWiki
While using Replace Error Code with Exception is an improvement, exceptions should still only be used for exceptional behaviour. They should not act as a substitute for tests.
The caller of the method throwing the exception should pass the test first. A simple example would be returning a value from an array - rather than throwing an ArrayOutOfBoundsException, you would check that the value passed is within array boundaries before checking the array.
See Also: