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.Text;
using System.Threading; using System.Threading;
using NLog; using NLog;
using NLog.Fluent;
using NLog.Targets; using NLog.Targets;
using Torch.Utils; using Torch.Utils;
@@ -36,11 +37,19 @@ namespace Torch.Server
"System.Security.Principal.Windows.dll" "System.Security.Principal.Windows.dll"
}; };
try
{
foreach (var file in badDlls) foreach (var file in badDlls)
{ {
if (File.Exists(file)) if (File.Exists(file))
File.Delete(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()) if (!TorchLauncher.IsTorchWrapped())
{ {