From 37a4cc599ba54421f38811e6b2e6ff76fb5f45c0 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 2 Jun 2020 15:05:57 +0200 Subject: [PATCH] Remove duplicate code Co-authored-by: Vasily --- .../HttpServer/HttpListenerHost.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 9e8c3eb9b..b1a5c6dc5 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -230,13 +230,9 @@ namespace Emby.Server.Implementations.HttpServer httpRes.StatusCode = statusCode; - if (!_hostEnvironment.IsDevelopment()) - { - await httpRes.WriteAsync("Error processing request.").ConfigureAwait(false); - return; - } - - var errContent = NormalizeExceptionMessage(ex) ?? string.Empty; + var errContent = _hostEnvironment.IsDevelopment() + ? (NormalizeExceptionMessage(ex) ?? string.Empty) + : "Error processing request."; httpRes.ContentType = "text/plain"; httpRes.ContentLength = errContent.Length; await httpRes.WriteAsync(errContent).ConfigureAwait(false);