mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Clean up HTTP listener exception handling
This commit is contained in:
parent
aa546dd36a
commit
92628c4033
@ -527,22 +527,18 @@ namespace Emby.Server.Implementations.HttpServer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await ErrorHandler(new FileNotFoundException(), httpReq, false).ConfigureAwait(false);
|
throw new FileNotFoundException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) when (ex is SocketException || ex is IOException || ex is OperationCanceledException)
|
|
||||||
{
|
|
||||||
await ErrorHandler(ex, httpReq, false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (SecurityException ex)
|
|
||||||
{
|
|
||||||
await ErrorHandler(ex, httpReq, false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
var logException = !string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase);
|
bool ignoreStackTrace =
|
||||||
|
ex is SocketException ||
|
||||||
await ErrorHandler(ex, httpReq, logException).ConfigureAwait(false);
|
ex is IOException ||
|
||||||
|
ex is OperationCanceledException ||
|
||||||
|
ex is SecurityException ||
|
||||||
|
ex is FileNotFoundException;
|
||||||
|
await ErrorHandler(ex, httpReq, ignoreStackTrace).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user