mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 09:06:33 +00:00
add correct business exception handling
use <FrameworkReference Include="Microsoft.AspNetCore.App" /> instead of old nuget packages
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using Azaion.Common;
|
||||
using Azaion.Common.Configs;
|
||||
using Azaion.Common.Database;
|
||||
using Azaion.Common.Entities;
|
||||
@@ -107,6 +108,7 @@ builder.Services.AddScoped<ICache, MemoryCache>();
|
||||
|
||||
builder.Services.AddValidatorsFromAssemblyContaining<RegisterUserValidator>();
|
||||
|
||||
builder.Services.AddExceptionHandler<BusinessExceptionHandler>();
|
||||
var app = builder.Build();
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
@@ -181,5 +183,6 @@ app.MapPut("/users/queue-offsets/{email}",
|
||||
.RequireAuthorization()
|
||||
.WithOpenApi(op => new OpenApiOperation(op) { Summary = "Updates user queue offsets" });
|
||||
|
||||
app.UseExceptionHandler(_ => {});
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user