Consider returning a boolean value rather than throwing an exception.