Added more specific exception handling to python example

This commit is contained in:
Brian Carrier
2015-08-19 23:47:59 -04:00
parent f595d3fe12
commit 743b360d60
2 changed files with 10 additions and 8 deletions
@@ -134,6 +134,8 @@ class RunExeIngestModule(DataSourceIngestModule):
reportHandle = open(reportPath, 'w')
# Run the EXE, saving output to the report
# NOTE: we should really be checking for if the module has been
# cancelled and then killing the process.
self.log(Level.INFO, "Running program on data source")
subprocess.Popen([self.path_to_exe, imagePaths[0]], stdout=reportHandle).communicate()[0]
reportHandle.close()
@@ -141,4 +143,4 @@ class RunExeIngestModule(DataSourceIngestModule):
# Add the report to the case, so it shows up in the tree
Case.getCurrentCase().addReport(reportPath, "Run EXE", "img_stat output")
return IngestModule.ProcessResult.OK
return IngestModule.ProcessResult.OK