DEV Community

Discussion on: Avoiding Exceptions in ASP.NET Core

Collapse
 
kyleljohnson profile image
Kyle Johnson

I don't see a lot of exception handling code because I believe in writing preventive code whenever in the stack that makes sense.

Collapse
 
sam_ferree profile image
Sam Ferree

Yup. That’s mostly my intent here. Services with preventative code. In the event of some inability to complete the request, the services know more about what kind of failure happened than the controller, so I use the this enable them to dictate the correct HTTP Response.