From 83d687825dbe9212397a09547838eaf89058caad Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 22 May 2019 02:38:39 +0100 Subject: [PATCH] Avoid exceptions in some shutdown corner cases. Change-Id: I1c301dc96d925fd5d74c00bf4b9417782822a997 --- wsd/DocumentBroker.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 698f3dd98..eb8fb1eee 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -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()); + } } }