Explorar o código

Remove duplicate code

Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
David %!s(int64=5) %!d(string=hai) anos
pai
achega
37a4cc599b
Modificáronse 1 ficheiros con 3 adicións e 7 borrados
  1. 3 7
      Emby.Server.Implementations/HttpServer/HttpListenerHost.cs

+ 3 - 7
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);