update logging

This commit is contained in:
Luke Pulverenti
2016-12-26 12:38:12 -05:00
parent 5765b51680
commit 325066f7ed
7 changed files with 27 additions and 7 deletions

View File

@@ -228,11 +228,14 @@ namespace Emby.Server.Implementations.HttpServer
}
}
private void ErrorHandler(Exception ex, IRequest httpReq)
private void ErrorHandler(Exception ex, IRequest httpReq, bool logException = true)
{
try
{
_logger.ErrorException("Error processing request", ex);
if (logException)
{
_logger.ErrorException("Error processing request", ex);
}
var httpRes = httpReq.Response;
@@ -529,6 +532,10 @@ namespace Emby.Server.Implementations.HttpServer
ErrorHandler(new FileNotFoundException(), httpReq);
}
}
catch (OperationCanceledException ex)
{
ErrorHandler(ex, httpReq, false);
}
catch (Exception ex)
{
ErrorHandler(ex, httpReq);