Handle ANY Exception On Routes - ASP NET Core Middleware
June 10, 2024
• 749 views
exception handlingexception c#dotnetc# exceptionsglobal exception handling in asp.net coreglobal exception handling in asp.net core web apiglobal error handling in asp.net core web apiglobal exception handling in microservices.netcsharpmiddlewareasp.netasp net coreasp netasp.net middlewareasp.net core middleware pipelineasp.net core middleware tutorialasp.net core middleware pipeline explainedcustom middleware asp.net corewhat is middlewareaspnet
How is it that ASP NET Core servers don't crash when there's an unhandled exception on a route thanks to a web request? Surely... they don't have a big try/catch block behind the scenes?!
Surprise -- they do. Fortunately for you, we can leverage middleware to hook into that and handle exceptions that bubble up from routes in our own way!
In this video, I'll walk through my own use case for wanting to have error-handling middleware and how you can incorporate such a thing in your own ASP NET Core applications.
