Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FloppyShelf/Problemize/llms.txt

Use this file to discover all available pages before exploring further.

Welcome to Problemize

Problemize is a robust and extensible framework for centralized exception handling in .NET Web APIs. It automatically converts unhandled exceptions into standardized RFC 9457 Problem Details responses, making your API error handling clean, consistent, and maintainable.

Why Problemize?

Zero boilerplate

Two-line setup with extension methods. No controllers to modify, no try-catch blocks to write.

Standardized responses

Automatic ProblemDetails formatting following RFC 9457 specification for consistent error responses.

Smart status mapping

Built-in mapping for common .NET exceptions to appropriate HTTP status codes.

Fully extensible

Implement custom status code mappers for your domain-specific exceptions.

Key features

Global exception handler middleware that catches all unhandled exceptions and converts them to standardized ProblemDetails responses.
The StatusCodeMapper automatically maps common exceptions:
  • ArgumentException → 400 Bad Request
  • UnauthorizedAccessException → 401 Unauthorized
  • KeyNotFoundException → 404 Not Found
  • NotImplementedException → 501 Not Implemented
  • And many more…
Special handling for ValidationException with ValidationProblemDetails responses.
Automatically includes request trace identifiers, activity IDs, and request instance information.

Example response

When an exception occurs, Problemize automatically generates a structured response:
{
  "title": "An error occured while validating your request",
  "detail": "Invalid data",
  "type": "ValidationException",
  "status": 400,
  "instance": "POST /api/users",
  "extensions": {
    "requestId": "00-abcd1234...",
    "activityId": "00-xyz5678..."
  }
}

Get started

Installation

Install the NuGet package and add to your project

Quickstart

Get up and running in under 2 minutes
Problemize integrates seamlessly with ASP.NET Core’s built-in IExceptionHandler and IProblemDetailsService interfaces.

Architecture overview

Problemize consists of four main components:
1

IStatusCodeMapper

Interface for mapping exceptions to HTTP status codes. Enables custom exception handling logic.
2

StatusCodeMapper

Default implementation handling common .NET exceptions with sensible HTTP status codes.
3

ExceptionHandler

ASP.NET Core IExceptionHandler implementation that orchestrates exception conversion to ProblemDetails.
4

Configurator

Extension methods for clean service registration and middleware configuration.

Philosophy

Problemize follows the principle that exception handling should be centralized and consistent. Instead of scattering try-catch blocks throughout your controllers, let Problemize handle exceptions globally while providing the flexibility to customize behavior when needed.
This library is designed for Web APIs. It uses ASP.NET Core middleware and requires Microsoft.AspNetCore.App framework.

Build docs developers (and LLMs) love