mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Added exceptions to ingest module exceptions
This commit is contained in:
parent
ce264d939d
commit
dc65fed3e9
@ -79,7 +79,7 @@ public final class EmbeddedFileExtractorIngestModule implements FileIngestModule
|
|||||||
} catch (SecurityException ex) {
|
} catch (SecurityException ex) {
|
||||||
logger.log(Level.SEVERE, "Error initializing output dir: " + moduleDirAbsolute, ex); //NON-NLS
|
logger.log(Level.SEVERE, "Error initializing output dir: " + moduleDirAbsolute, ex); //NON-NLS
|
||||||
services.postMessage(IngestMessage.createErrorMessage(EmbeddedFileExtractorModuleFactory.getModuleName(), "Error initializing", "Error initializing output dir: " + moduleDirAbsolute)); //NON-NLS
|
services.postMessage(IngestMessage.createErrorMessage(EmbeddedFileExtractorModuleFactory.getModuleName(), "Error initializing", "Error initializing output dir: " + moduleDirAbsolute)); //NON-NLS
|
||||||
throw new IngestModuleException(ex.getMessage());
|
throw new IngestModuleException(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public final class EmbeddedFileExtractorIngestModule implements FileIngestModule
|
|||||||
try {
|
try {
|
||||||
fileTypeDetector = new FileTypeDetector();
|
fileTypeDetector = new FileTypeDetector();
|
||||||
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
||||||
throw new IngestModuleException(ex.getMessage());
|
throw new IngestModuleException(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize the extraction modules.
|
// initialize the extraction modules.
|
||||||
|
@ -133,7 +133,7 @@ class SevenZipExtractor {
|
|||||||
String details = NbBundle.getMessage(SevenZipExtractor.class, "EmbeddedFileExtractorIngestModule.ArchiveExtractor.init.errCantInitLib",
|
String details = NbBundle.getMessage(SevenZipExtractor.class, "EmbeddedFileExtractorIngestModule.ArchiveExtractor.init.errCantInitLib",
|
||||||
e.getMessage());
|
e.getMessage());
|
||||||
services.postMessage(IngestMessage.createErrorMessage(EmbeddedFileExtractorModuleFactory.getModuleName(), msg, details));
|
services.postMessage(IngestMessage.createErrorMessage(EmbeddedFileExtractorModuleFactory.getModuleName(), msg, details));
|
||||||
throw new IngestModuleException(e.getMessage());
|
throw new IngestModuleException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
@ -91,7 +91,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule {
|
|||||||
try {
|
try {
|
||||||
fileTypeDetector = new FileTypeDetector();
|
fileTypeDetector = new FileTypeDetector();
|
||||||
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
||||||
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg"));
|
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class FileTypeIdIngestModule implements FileIngestModule {
|
|||||||
try {
|
try {
|
||||||
fileTypeDetector = new FileTypeDetector();
|
fileTypeDetector = new FileTypeDetector();
|
||||||
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
||||||
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.startUp.fileTypeDetectorInitializationException.msg"));
|
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
|
|||||||
// Initialize job totals
|
// Initialize job totals
|
||||||
initTotalsForIngestJob(jobId);
|
initTotalsForIngestJob(jobId);
|
||||||
} catch (SecurityException | IOException | UnsupportedOperationException ex) {
|
} catch (SecurityException | IOException | UnsupportedOperationException ex) {
|
||||||
throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage()));
|
throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage()), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -396,7 +396,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
|
|||||||
} catch (FileAlreadyExistsException ex) {
|
} catch (FileAlreadyExistsException ex) {
|
||||||
// No worries.
|
// No worries.
|
||||||
} catch (IOException | SecurityException | UnsupportedOperationException ex) {
|
} catch (IOException | SecurityException | UnsupportedOperationException ex) {
|
||||||
throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage()));
|
throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage()), ex);
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
try {
|
try {
|
||||||
fileTypeDetector = new FileTypeDetector();
|
fileTypeDetector = new FileTypeDetector();
|
||||||
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
|
||||||
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg"));
|
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex);
|
||||||
}
|
}
|
||||||
ingester = Server.getIngester();
|
ingester = Server.getIngester();
|
||||||
this.context = context;
|
this.context = context;
|
||||||
@ -162,7 +162,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
String details = NbBundle.getMessage(this.getClass(), "SolrConnectionCheck.Port");
|
String details = NbBundle.getMessage(this.getClass(), "SolrConnectionCheck.Port");
|
||||||
logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()});
|
logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()});
|
||||||
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
|
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
|
||||||
throw new IngestModuleException(msg);
|
throw new IngestModuleException(msg, ex);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
kwsService.tryConnect(UserPreferences.getIndexingServerHost(), port);
|
kwsService.tryConnect(UserPreferences.getIndexingServerHost(), port);
|
||||||
@ -171,7 +171,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
String details = ex.getMessage();
|
String details = ex.getMessage();
|
||||||
logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()});
|
logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()});
|
||||||
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
|
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
|
||||||
throw new IngestModuleException(msg);
|
throw new IngestModuleException(msg, ex);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// for single-user cases need to verify connection to local SOLR service
|
// for single-user cases need to verify connection to local SOLR service
|
||||||
@ -189,7 +189,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
|
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
|
||||||
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
||||||
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
|
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details));
|
||||||
throw new IngestModuleException(msg);
|
throw new IngestModuleException(msg, ex);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// make an actual query to verify that server is responding
|
// make an actual query to verify that server is responding
|
||||||
@ -198,7 +198,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
} catch (KeywordSearchModuleException | NoOpenCoreException ex) {
|
} catch (KeywordSearchModuleException | NoOpenCoreException ex) {
|
||||||
throw new IngestModuleException(
|
throw new IngestModuleException(
|
||||||
NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.exception.errConnToSolr.msg",
|
NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.exception.errConnToSolr.msg",
|
||||||
ex.getMessage()));
|
ex.getMessage()), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if this job has any searchable keywords
|
// check if this job has any searchable keywords
|
||||||
|
@ -161,11 +161,11 @@ class SearchEngineURLQueryAnalyzer extends Extract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IngestModuleException("Was not able to load SEUQAMappings.xml: " + e.getLocalizedMessage()); //NON-NLS
|
throw new IngestModuleException("Was not able to load SEUQAMappings.xml: " + e.getLocalizedMessage(), e); //NON-NLS
|
||||||
} catch (ParserConfigurationException pce) {
|
} catch (ParserConfigurationException pce) {
|
||||||
throw new IngestModuleException("Unable to build XML parser: " + pce.getLocalizedMessage()); //NON-NLS
|
throw new IngestModuleException("Unable to build XML parser: " + pce.getLocalizedMessage(), pce); //NON-NLS
|
||||||
} catch (SAXException sxe) {
|
} catch (SAXException sxe) {
|
||||||
throw new IngestModuleException("Unable to parse XML file: " + sxe.getLocalizedMessage()); //NON-NLS
|
throw new IngestModuleException("Unable to parse XML file: " + sxe.getLocalizedMessage(), sxe); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeList nlist = xmlinput.getElementsByTagName("SearchEngine"); //NON-NLS
|
NodeList nlist = xmlinput.getElementsByTagName("SearchEngine"); //NON-NLS
|
||||||
@ -394,7 +394,7 @@ class SearchEngineURLQueryAnalyzer extends Extract {
|
|||||||
String message = NbBundle
|
String message = NbBundle
|
||||||
.getMessage(this.getClass(), "SearchEngineURLQueryAnalyzer.init.exception.msg", XMLFILE);
|
.getMessage(this.getClass(), "SearchEngineURLQueryAnalyzer.init.exception.msg", XMLFILE);
|
||||||
logger.log(Level.SEVERE, message, e);
|
logger.log(Level.SEVERE, message, e);
|
||||||
throw new IngestModuleException(message);
|
throw new IngestModuleException(message, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadConfigFile();
|
loadConfigFile();
|
||||||
|
@ -106,7 +106,7 @@ class ScalpelCarverIngestModule implements FileIngestModule {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
String message = NbBundle.getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg4");
|
String message = NbBundle.getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg4");
|
||||||
logger.log(Level.SEVERE, message, ex);
|
logger.log(Level.SEVERE, message, ex);
|
||||||
throw new IngestModuleException(message);
|
throw new IngestModuleException(message, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user