Use exceptions to stop the search