.NET Core API -Exception Handling
When building an API, having exception handling is a must for the consistency of the application. We obviously don’t want any weird behavior unhandled.
It gets more tricky when we have a custom exception that is handled on a case-specific basis. i.e: Entity validation, not found resource, etc.
that's where having an exception middleware to handle exception types can be helpful.