Преглед на файлове

Handle Kestrel startup failures with a nice error

Joshua Boniface преди 5 години
родител
ревизия
387192610f
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 9 1
      Emby.Server.Implementations/ApplicationHost.cs

+ 9 - 1
Emby.Server.Implementations/ApplicationHost.cs

@@ -663,7 +663,15 @@ namespace Emby.Server.Implementations
                 })
                 .Build();
 
-            await host.StartAsync().ConfigureAwait(false);
+            try
+            {
+                await host.StartAsync().ConfigureAwait(false);
+            }
+            catch (Exception ex)
+            {
+                Logger.LogError("Kestrel failed to start! This is most likely due to an invalid address or port bind - correct your bind configuration in system.xml and try again.");
+                throw;
+            }
         }
 
         private async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next)