Fixed api exception handler

This commit is contained in:
Masu-Baumgartner
2024-11-21 09:41:53 +01:00
parent fe31c01a06
commit f702167d6e
2 changed files with 8 additions and 2 deletions

View File

@@ -129,6 +129,7 @@ public class Startup
{
WebApplicationBuilder.Services.AutoAddServices<Startup>();
WebApplicationBuilder.Services.AddHttpClient();
WebApplicationBuilder.Services.AddApiExceptionHandler();
// Add pre-existing services
@@ -151,7 +152,7 @@ public class Startup
private Task UseBase()
{
WebApplication.UseRouting();
WebApplication.UseExceptionHandler("/");
WebApplication.UseApiExceptionHandler();
if (Configuration.Client.Enable)
{
@@ -447,6 +448,11 @@ public class Startup
"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware",
LogLevel.Critical
);
WebApplicationBuilder.Logging.AddFilter(
"Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware",
LogLevel.Critical
);
}
#endregion