.NET › Global Exception Handling & Middleware
What happens by default in ASP.NET Core if you don't configure any global exception handling middleware at all?
BeginnerAnswer
Without any exception handling middleware configured, an unhandled exception propagates all the way up through Kestrel, resulting in either a bare 500 Internal Server Error with no body (in Production) or, if UseDeveloperExceptionPage is active, a detailed HTML error page showing the full stack trace -- neither is appropriate for a real production API, which is why configuring at least a basic UseExceptionHandler is considered essential baseline setup for any API expected to run in production.
// With NO exception handling middleware configured:
// An unhandled exception results in a generic 500 with an empty or minimal body
// -- no consistent JSON error format, no logging guarantee, no safe error messageReal-world example A newly bootstrapped API prototype that skipped configuring UseExceptionHandler entirely is caught in code review before its first production deployment, since every unhandled exception would otherwise return an unhelpful bare 500 response to API consumers.