mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-27 11:14:47 +03:00
Remove duplicate code
Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user