Avoid exceptions in some shutdown corner cases.

Change-Id: I1c301dc96d925fd5d74c00bf4b9417782822a997
This commit is contained in:
Michael Meeks 2019-05-22 02:38:39 +01:00
parent 4f804a48fe
commit 83d687825d

View file

@ -1915,11 +1915,14 @@ void ConvertToBroker::removeFile(const std::string &uriOrig)
{
if (!uriOrig.empty())
{
// Remove source file and directory
Poco::Path path = uriOrig;
Poco::File(path).remove();
Poco::File(path.makeParent()).remove();
FileUtil::removeFile(uriOrig);
try {
// Remove source file and directory
Poco::Path path = uriOrig;
Poco::File(path).remove();
Poco::File(path.makeParent()).remove();
} catch (const std::exception &ex) {
LOG_ERR("Error while removing conversion temporary: '" << uriOrig << "' - " << ex.what());
}
}
}