Adds global exception handling middleware to the API

This commit is contained in:
BinaryAlley committed 2026-08-22 00:43:52 -07:00
1 parent 9ea69e6ffc
commit c2e00242cc
4 files changed
+270 -1

No files matched your search

+2 -1
View File
@@ -10,6 +10,7 @@ using Lumina.Infrastructure.Common.DependencyInjection;
using Lumina.Infrastructure.Core.MediaLibrary.Management.Scanning.Progress;
using Lumina.Presentation.Api.Common.DependencyInjection;
using Lumina.Presentation.Api.Common.Middlewares;
using Lumina.Presentation.Api.Common.Utilities;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Data.Sqlite;
@@ -107,7 +108,7 @@ public class Program
app.UseRouting();
app.UseCors("SecurePolicy");
//app.UseExceptionHandler("/error"); // uses a middleware which re-executes the request to the error path
app.UseApiExceptionHandling(); // catches any unhandled exception and returns a ProblemDetails response
//app.UseHttpsRedirection();