Error handling

This commit is contained in:
John Gross
2019-06-06 18:06:28 -07:00
parent 97f380fb7b
commit 0e6ac14b74

View File

@@ -9,6 +9,7 @@ using System.ServiceProcess;
using System.Text;
using System.Threading;
using NLog;
using NLog.Fluent;
using NLog.Targets;
using Torch.Utils;
@@ -35,11 +36,19 @@ namespace Torch.Server
{
"System.Security.Principal.Windows.dll"
};
foreach (var file in badDlls)
try
{
if (File.Exists(file))
File.Delete(file);
foreach (var file in badDlls)
{
if (File.Exists(file))
File.Delete(file);
}
}
catch
{
LogManager.GetCurrentClassLogger().Error($"Error updating. Please delete the following files from the Torch root folder manually:\r\n{string.Join("\r\n", badDlls)}");
return;
}
if (!TorchLauncher.IsTorchWrapped())