Skip to content
Snippets Groups Projects
Commit add101f9 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

fileutils: catch exceptions in removeAll

Change-Id: Ia0c3c975961bf96c6db80ed8f5c7b45bdee7e9cb
parent b1bf24c6
Branches
No related tags found
No related merge requests found
...@@ -336,6 +336,7 @@ remove(const std::filesystem::path& path, bool erase) ...@@ -336,6 +336,7 @@ remove(const std::filesystem::path& path, bool erase)
int int
removeAll(const std::filesystem::path& path, bool erase) removeAll(const std::filesystem::path& path, bool erase)
{ {
try {
std::error_code ec; std::error_code ec;
if (not erase) { if (not erase) {
std::filesystem::remove_all(path, ec); std::filesystem::remove_all(path, ec);
...@@ -351,6 +352,10 @@ removeAll(const std::filesystem::path& path, bool erase) ...@@ -351,6 +352,10 @@ removeAll(const std::filesystem::path& path, bool erase)
} }
} }
return remove(path, erase); return remove(path, erase);
} catch (const std::exception& e) {
//JAMI_ERR("Error while removing %s: %s", path.c_str(), e.what());
return -1;
}
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment