Browse Source

Remove duplicate code

Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
David 5 năm trước cách đây
mục cha
commit
6d9f564a94
1 tập tin đã thay đổi với 3 bổ sung7 xóa
  1. 3 7
      Jellyfin.Server/Middleware/ExceptionMiddleware.cs

+ 3 - 7
Jellyfin.Server/Middleware/ExceptionMiddleware.cs

@@ -93,13 +93,9 @@ namespace Jellyfin.Server.Middleware
                 context.Response.ContentType = MediaTypeNames.Text.Plain;
 
                 // Don't send exception unless the server is in a Development environment
-                if (!_hostEnvironment.IsDevelopment())
-                {
-                    await context.Response.WriteAsync("Error processing request.").ConfigureAwait(false);
-                    return;
-                }
-
-                var errorContent = NormalizeExceptionMessage(ex.Message);
+                var errorContent = _hostEnvironment.IsDevelopment()
+                        ? NormalizeExceptionMessage(ex.Message)
+                        : "Error processing request.";
                 await context.Response.WriteAsync(errorContent).ConfigureAwait(false);
             }
         }