Added call to get() to retrieve keyword search errors in background thread

This commit is contained in:
Brian Carrier 2014-03-03 17:23:55 -05:00
parent cc03f81652
commit c8508ecdf3

View File

@ -30,6 +30,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level;
@ -44,7 +45,6 @@ import org.netbeans.api.progress.aggregate.AggregateProgressFactory;
import org.netbeans.api.progress.aggregate.AggregateProgressHandle;
import org.netbeans.api.progress.aggregate.ProgressContributor;
import org.openide.util.Cancellable;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
@ -1184,6 +1184,18 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
return null;
}
@Override
protected void done() {
// call get to see if there were any errors
try {
get();
}
catch (InterruptedException | ExecutionException e) {
logger.log(Level.SEVERE, "Error performing keyword search: " + e.getMessage());
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, "Error performing keyword search", e.getMessage()));
}
}
/**
* Sync-up the updated keywords from the currently used lists in the XML
*/