cellGame: report fs::remove_all failure

This commit is contained in:
Eladash authored and Ivan committed 2020-02-04 18:29:52 +03:00
1 parent 4488312e81
commit cb52ee0a4d
1 file changed
+10 -3
+10 -3
View File
@@ -133,16 +133,23 @@ struct content_permission final
~content_permission()
{
bool success = false;
fs::g_tls_error = fs::error::ok;
try
{
if (temp.size() > 1)
if (temp.size() <= 1 || fs::remove_all(temp))
{
fs::remove_all(temp);
success = true;
}
}
catch (...)
{
cellGame.fatal("Failed to clean directory '%s'", temp);
}
if (!success)
{
cellGame.fatal("Failed to clean directory '%s' (%s)", temp, fs::g_tls_error);
}
}
};