1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-25 07:32:38 +00:00

improve HttpListenerException handling

This commit is contained in:
kaso17 2017-01-26 15:25:44 +01:00
parent 4d952fc754
commit 238908ee32

View file

@ -223,9 +223,14 @@ namespace Jackett.Services
catch (TargetInvocationException e)
{
var inner = e.InnerException;
if (inner is SocketException && ((SocketException)inner).SocketErrorCode == SocketError.AddressAlreadyInUse)
if (inner is SocketException && ((SocketException)inner).SocketErrorCode == SocketError.AddressAlreadyInUse) // Linux (mono)
{
logger.Error("Address already in use: Most likely Jackett is already running");
logger.Error("Address already in use: Most likely Jackett is already running.");
Environment.Exit(1);
}
else if (inner is HttpListenerException && ((HttpListenerException)inner).ErrorCode == 183) // Windows
{
logger.Error(inner.Message + " Most likely Jackett is already running.");
Environment.Exit(1);
}
throw e;