Throw exception on precondition failure.
Fixes #7967.

svn path=/trunk/tools/auto_index/; revision=83952
Fix bug for situation where no suitable index location is found.

svn path=/trunk/tools/auto_index/; revision=84180