Navigation Menu

Skip to content

Commit

Permalink
Added error message to help debug idResolver issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedurbin committed Apr 20, 2015
1 parent 445a679 commit e811073
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -35,7 +35,7 @@
public class DirectoryScanningIDResolver implements InternalIDResolver {

private static final Logger LOGGER = getLogger(InternalIDResolver.class);

private IndexSearcher searcher;

public DirectoryScanningIDResolver(final File indexDir, final File dsRoot) throws IOException {
Expand Down Expand Up @@ -66,7 +66,7 @@ public CachedContent resolveInternalID(final String id) {
if (result.totalHits == 1) {
return new FileCachedContent(new File(searcher.doc(result.scoreDocs[0].doc).get("path")));
} else if (result.totalHits < 1) {
return null;
throw new RuntimeException("Unable to resolve internal ID \"" + id + "\"!");
} else {
throw new IllegalStateException(result.totalHits + " files matched the internal id \"" + id + "\". ("
+ searcher.doc(result.scoreDocs[0].doc).get("path") + ", "
Expand Down

0 comments on commit e811073

Please sign in to comment.