mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
Stats Page Overhaul (#4292)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Net;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using API.Errors;
|
||||
using Kavita.Common;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -21,6 +22,11 @@ public class ExceptionMiddleware(RequestDelegate next, ILogger<ExceptionMiddlewa
|
||||
{
|
||||
await next(context); // downstream middlewares or http call
|
||||
}
|
||||
catch (KavitaUnauthenticatedUserException)
|
||||
{
|
||||
context.Response.StatusCode = (int) HttpStatusCode.Unauthorized;
|
||||
await context.Response.CompleteAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "There was an exception");
|
||||
|
||||
Reference in New Issue
Block a user