say NO to try-catch in controllers
- added ExceptionsMiddleware.cs - added more Exception types - removed all exceptions logic in controllers
This commit is contained in:
parent
eb271793ad
commit
55e82425a9
8 changed files with 75 additions and 20 deletions
|
|
@ -7,6 +7,7 @@ using SurveyBackend.Core.Services;
|
|||
using SurveyBackend.Infrastructure;
|
||||
using SurveyBackend.Infrastructure.Data;
|
||||
using SurveyBackend.Infrastructure.Repositories;
|
||||
using SurveyBackend.Middlewares;
|
||||
using SurveyBackend.Services;
|
||||
using SurveyBackend.Services.Services;
|
||||
using SurveyLib.Core.Repositories;
|
||||
|
|
@ -71,6 +72,8 @@ public class Program
|
|||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseMiddleware<ExceptionsMiddleware>();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue