Error Handling
Developer Exception Page
The Developer Exception Page displays detailed information about request exceptions. The page is made available by Microsoft.AspNetCore.Diagnostics
package, which is in the Microsoft.AspNetCore.App
metapackage.
Enable the Developer Exception Page only when the app is running in the Development environment.
Exception handler page
To configure a custom error handling page for the Production environment, use the Exception Handling Middleware. The middleware:
Catches and logs exceptions.
Re-executes the request in an alternate pipeline for the page or controller indicated.
Database error page
The Database Error Page middleware captures database-related exceptions that can be resolved by using Entity Framework migrations.
Exception filters
Exception filters:
Implement
IExceptionFilter
orIAsyncExceptionFilter
.Can be used to implement common error handling policies.
Last updated