mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
Catch exceptions when deleting files/folders
This commit is contained in:
parent
b22d72a1b8
commit
b6de3645b7
@ -920,7 +920,16 @@ namespace Bloxstrap
|
||||
continue;
|
||||
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Removing old version folder for {dir.Name}");
|
||||
dir.Delete(true);
|
||||
|
||||
try
|
||||
{
|
||||
dir.Delete(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Failed to delete version folder!");
|
||||
App.Logger.WriteException(LOG_IDENT, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,16 @@
|
||||
continue;
|
||||
|
||||
WriteLine(LOG_IDENT, $"Cleaning up old log file '{log.Name}'");
|
||||
log.Delete();
|
||||
|
||||
try
|
||||
{
|
||||
log.Delete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WriteLine(LOG_IDENT, "Failed to delete log!");
|
||||
WriteException(LOG_IDENT, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user