Merge pull request #604 from sp-tarkov/prevent-close

Prevent closing the server if an exception happens
This commit is contained in:
Chomp
2025-10-06 11:24:56 +00:00
committed by GitHub
+18
View File
@@ -28,6 +28,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;
@@ -104,6 +121,7 @@ public static class Program
{
Console.WriteLine(ex);
serverExceptionLogger.LogCritical(ex, "Critical exception, stopping server...");
throw;
}
finally
{