Trap Kestrel Address bind exception to avoid bootloop

pull/2/head
ta264 4 years ago
parent 2c6b13dd11
commit 6ad3653c04

@ -1,5 +1,7 @@
using System;
using System.IO;
using System.Net.Sockets;
using Microsoft.AspNetCore.Connections;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Exceptions;
@ -49,9 +51,23 @@ namespace NzbDrone.Console
{
System.Console.WriteLine("");
System.Console.WriteLine("");
Logger.Fatal(ex.Message + ". This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions");
Logger.Fatal(ex.Message + " This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions");
Exit(ExitCodes.RecoverableFailure);
}
catch (IOException ex)
{
if (ex.InnerException is AddressInUseException)
{
System.Console.WriteLine("");
System.Console.WriteLine("");
Logger.Fatal(ex.Message + " This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions");
Exit(ExitCodes.RecoverableFailure);
}
else
{
throw;
}
}
catch (RemoteAccessException ex)
{
System.Console.WriteLine("");

Loading…
Cancel
Save