Cześć Piszę API i chciałbym wyswietlić error z API na Angularze ale jak łapie wyjątek to mam coś takiego:
core.js:6014 ERROR Error: System.UnauthorizedAccessException: Użytkownik został zablokowany
at Work.Repositories.Implementations.AccountRepository.LoginUserAsync(UserLoginDto login) in C:\Users\michal.warmuz\Desktop\Work\WorkAPI\Work.Data\Work.Repositories\Implementations\AccountRepository.cs:line 143
at Work.BusinessService.Implementations.AccountBusinessService.LoginUserAsync(UserLoginDto login) in C:\Users\michal.warmuz\Desktop\Work\WorkAPI\Work.Application\Work.BusinessService\Implementations\AccountBusinessService.cs:line 49
at Work.ApplicationService.Implementations.AccountService.LoginUserAsync(UserLoginDto loginUserCommand) in C:\Users\michal.warmuz\Desktop\Work\WorkAPI\Work.Application\Work.ApplicationService\Implementations\AccountService.cs:line 48
at Work.API.Controllers.AccountController.<>c__DisplayClass3_0.<<Login>b__0>d.MoveNext() in C:\Users\michal.warmuz\Desktop\Work\WorkAPI\Work.API\Controllers\AccountController.cs:line 33
--- End of stack trace from previous location where exception was thrown ---
at Work.API.Controllers.Base.BaseController.Handle(Func`1 func) in C:\Users\michal.warmuz\Desktop\Work\WorkAPI\Work.API\Controllers\Base\BaseController.cs:line 23
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Moge to jakoś skrócić aby była informacja tylko Użytkownik jest zablokowany ? :)