Do not delete temp TRAP files when file level exception is caught

This commit is contained in:
Tamas Vajk
2022-01-24 10:56:18 +01:00
committed by Ian Lynagh
parent 82fe08ea8e
commit 300719a07a
2 changed files with 2 additions and 6 deletions

View File

@@ -66,8 +66,7 @@ class ExternalClassExtractor(val logger: FileLogger, val invocationTrapFile: Str
} catch (e: Exception) {
manager.setHasError()
trapTmpFile.delete()
logger.error("Failed to extract '$binaryPath'", e)
logger.error("Failed to extract '$binaryPath'. Partial TRAP file location is $trapTmpFile", e)
}
}
}

View File

@@ -151,10 +151,7 @@ fun doFile(invocationTrapFile: String,
}
}
} catch (e: Exception) {
logger.error("Failed to extract '$srcFilePath'", e)
if (!trapTmpFile.delete()) {
logger.warn(Severity.WarnLow, "Failed to delete $trapTmpFile")
}
logger.error("Failed to extract '$srcFilePath'. Partial TRAP file location is $trapTmpFile", e)
}
}
}