Try catch in case moving/deleting fails during recursive rollover

pull/35/head
Miepee 4 years ago
parent c06bdcfa31
commit c44ca404f0

@ -133,12 +133,20 @@ public static class HelperMethods
RecursiveRollover(fileName, max); RecursiveRollover(fileName, max);
//TODO: this can fail if one doesn't have permissions to move or delete the file //TODO: this can fail if one doesn't have permissions to move or delete the file
// maybe fixed?
try
{
// If index is less than max, rename file. // If index is less than max, rename file.
if (index < max) if (index < max)
File.Move(logFile, fileName); File.Move(logFile, fileName);
else // Otherwise, delete the file. else // Otherwise, delete the file.
File.Delete(logFile); File.Delete(logFile);
} }
catch
{
//ignore
}
}
/// <summary> /// <summary>
/// Checks if we currently have an internet connection, by pinging GitHub. /// Checks if we currently have an internet connection, by pinging GitHub.

Loading…
Cancel
Save