Remove duplicate code

Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
pull/3186/head
David 4 years ago committed by GitHub
parent a5a39300bc
commit 6d9f564a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save