cellGame: report fs::remove_all failure

This commit is contained in:
Eladash 2020-02-03 09:31:31 +02:00 committed by Ivan
parent 4488312e81
commit cb52ee0a4d

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);
}
}
};