diff options
| author | Vasily <just.one.man@yandex.ru> | 2019-10-09 14:00:22 +0300 |
|---|---|---|
| committer | Vasily <just.one.man@yandex.ru> | 2019-10-09 14:00:22 +0300 |
| commit | 8109c7eb303a914db5f034195d12cc8f54d5a6ae (patch) | |
| tree | 3ecf4508ded5eeba30059a87b7a45a189dc759a7 | |
| parent | 33b69a709997924aa2cf8ce06a46939d7243001b (diff) | |
Always log at least error message when error happens during request processing
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 5b1a07930..178b1ab82 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -208,7 +208,7 @@ namespace Emby.Server.Implementations.HttpServer } } - private async Task ErrorHandler(Exception ex, IRequest httpReq, bool logExceptionStackTrace, bool logExceptionMessage) + private async Task ErrorHandler(Exception ex, IRequest httpReq, bool logExceptionStackTrace) { try { @@ -218,9 +218,9 @@ namespace Emby.Server.Implementations.HttpServer { _logger.LogError(ex, "Error processing request"); } - else if (logExceptionMessage) + else { - _logger.LogError(ex.Message); + _logger.LogError("Error processing request: {0}", ex.Message); } var httpRes = httpReq.Response; @@ -511,22 +511,22 @@ namespace Emby.Server.Implementations.HttpServer } else { - await ErrorHandler(new FileNotFoundException(), httpReq, false, false).ConfigureAwait(false); + await ErrorHandler(new FileNotFoundException(), httpReq, false).ConfigureAwait(false); } } catch (Exception ex) when (ex is SocketException || ex is IOException || ex is OperationCanceledException) { - await ErrorHandler(ex, httpReq, false, false).ConfigureAwait(false); + await ErrorHandler(ex, httpReq, false).ConfigureAwait(false); } catch (SecurityException ex) { - await ErrorHandler(ex, httpReq, false, true).ConfigureAwait(false); + await ErrorHandler(ex, httpReq, false).ConfigureAwait(false); } catch (Exception ex) { var logException = !string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase); - await ErrorHandler(ex, httpReq, logException, false).ConfigureAwait(false); + await ErrorHandler(ex, httpReq, logException).ConfigureAwait(false); } finally { |
