handle failure of file removal

pull/836/head
Rafi Wiener 7 years ago committed by GitHub
parent 188cff7d65
commit f750840563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -101,7 +101,10 @@ private:
// this is a workaround to a windows issue, where very high rotation // this is a workaround to a windows issue, where very high rotation
// rates sometimes fail (because of antivirus?). // rates sometimes fail (because of antivirus?).
details::os::sleep_for_millis(20); details::os::sleep_for_millis(20);
details::os::remove(target); if (details::os::remove(target) != 0)
{
throw spdlog_ex("rotating_file_sink: failed removing " + filename_to_str(target), errno);
}
if (details::os::rename(src, target) != 0) if (details::os::rename(src, target) != 0)
{ {
throw spdlog_ex( throw spdlog_ex(

Loading…
Cancel
Save