Remove duplicate code

Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
This commit is contained in:
David 2020-06-02 15:04:55 +02:00 committed by GitHub
parent a5a39300bc
commit 6d9f564a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
}