1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 11:25:26 +00:00

Fixed: show a better error message when nzbdrone port is already in use.

This commit is contained in:
Keivan Beigi 2014-10-13 10:51:17 -07:00
parent f684d2f0d7
commit 690569cbbc

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Net.Sockets;
using NLog; using NLog;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation; using NzbDrone.Common.Instrumentation;
@ -18,6 +19,15 @@ public static void Main(string[] args)
LogTargets.Register(startupArgs, false, true); LogTargets.Register(startupArgs, false, true);
Bootstrap.Start(startupArgs, new ConsoleAlerts()); Bootstrap.Start(startupArgs, new ConsoleAlerts());
} }
catch (SocketException exception)
{
System.Console.WriteLine("");
System.Console.WriteLine("");
Logger.Fatal(exception.Message + ". This can happen if another instance of NzbDrone is already running or another applicaion is using the port assinged to NzbDrone (default: 8989)");
System.Console.WriteLine("Press any key to exit...");
System.Console.ReadLine();
Environment.Exit(1);
}
catch (Exception e) catch (Exception e)
{ {
System.Console.WriteLine(""); System.Console.WriteLine("");
@ -25,6 +35,7 @@ public static void Main(string[] args)
Logger.FatalException("EPIC FAIL!", e); Logger.FatalException("EPIC FAIL!", e);
System.Console.WriteLine("Press any key to exit..."); System.Console.WriteLine("Press any key to exit...");
System.Console.ReadLine(); System.Console.ReadLine();
Environment.Exit(1);
} }
Logger.Info("Exiting main."); Logger.Info("Exiting main.");