Prevent closing the server if an exception happens

This commit is contained in:
Alex
2025-10-06 12:16:49 +01:00
parent cbb84750af
commit 1f0991f695
+18
View File
@@ -26,6 +26,23 @@ namespace SPTarkov.Server;
public static class Program
{
public static async Task Main(string[] args)
{
try
{
await StartServer(args);
}
catch (Exception e)
{
Console.WriteLine("=========================================================================================================");
Console.WriteLine("The server has unexpectedly stopped, please check your log files and reach out to #spt-support in discord");
Console.WriteLine(e);
Console.WriteLine("=========================================================================================================");
Console.WriteLine("Press any key to exit...");
Console.ReadLine();
}
}
public static async Task StartServer(string[] args)
{
Console.OutputEncoding = Encoding.UTF8;
@@ -95,6 +112,7 @@ public static class Program
{
Console.WriteLine(ex);
serverExceptionLogger.LogCritical(ex, "Critical exception, stopping server...");
throw;
}
finally
{