Explorar o código

Handle Kestrel startup failures with a nice error

Joshua Boniface %!s(int64=5) %!d(string=hai) anos
pai
achega
387192610f
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  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)