aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid <daullmer@gmail.com>2020-06-02 15:05:57 +0200
committerGitHub <noreply@github.com>2020-06-02 15:05:57 +0200
commit37a4cc599ba54421f38811e6b2e6ff76fb5f45c0 (patch)
tree0a1f1fc9a0d397b96aed05317edb714a685b70ec
parente9ebe07ecc38726ad7f14c8d38131ce101a28651 (diff)
Remove duplicate code
Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs10
1 files 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);