What problem does it solve?
This Skill provides a comprehensive guide to implementing robust exception handling in ASP.NET Core Razor Pages applications, addressing issues such as unhandled exceptions, information leakage, and poor user experience.
Core Features & Use Cases
- Global Exception Handler Configuration: Set up global exception handling middleware for development and production environments.
- Custom Error Pages: Create custom error pages to display user-friendly messages.
- Exception Middleware: Implement custom middleware for more granular exception handling.
- Custom Exceptions: Define domain-specific exceptions for different error scenarios.
- ProblemDetails API: Utilize the ProblemDetails API for consistent error responses.
- Handler-Level Exception Handling: Implement exception handling at the handler level for better control.
- Background Service Exception Handling: Ensure background services handle exceptions gracefully.
- MediatR Exception Handling Behavior: Use MediatR to handle exceptions in a request-response pipeline.
- Anti-Patterns: Learn from common anti-patterns to avoid common pitfalls in exception handling.
Quick Start
Set up global exception handling in your ASP.NET Core Razor Pages application by configuring the exception handling middleware in Program.cs.