User475983607 posted
Error handling is an important part of any application. ASP.NET provides several different ways to handle errors. How to approach to handle errors in ASP.NET Core
Keep in mind, handling errors is a vast design subject.
i recommend reading the official documentation first. It you still have question after reading the documentation then share those questions here and explain exactly what you are trying to do.
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-5.0