mirror of
https://github.com/Jackett/Jackett
synced 2025-02-25 07:32:38 +00:00
improve HttpListenerException handling
This commit is contained in:
parent
4d952fc754
commit
238908ee32
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue