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.
Overview
Problem Details is a standardized format for HTTP API error responses defined in RFC 9457. Problemize generates Problem Details responses automatically for all unhandled exceptions, providing consistent, machine-readable error information to API clients.ProblemDetails vs ValidationProblemDetails
Problemize uses two types of Problem Details objects depending on the exception type:ProblemDetails
The standardProblemDetails class is used for all general exceptions:
Services/ExceptionHandler.cs
ValidationProblemDetails
When the exception is aValidationException, Problemize uses ValidationProblemDetails:
Services/ExceptionHandler.cs
ValidationProblemDetails extends ProblemDetails with an errors property that can contain structured validation errors, making it ideal for input validation scenarios.
ValidationProblemDetails inherits from ProblemDetails and adds support for the errors dictionary, which maps field names to validation error messages.Core structure
Every Problem Details response contains these standard fields:The exception type name (e.g.,
ArgumentNullException). This helps clients identify the error category.A human-readable summary of the error. Generic for the error category.
The HTTP status code (e.g., 400, 404, 500). Automatically set by the status code mapper.
The exception message. Provides specific information about this particular error instance.
The HTTP method and path that triggered the error (e.g.,
POST /api/orders). Helps with debugging and log correlation.Extensions
Problemize automatically adds two extension properties to help with debugging and distributed tracing:requestId
Configurator.cs
requestId contains ASP.NET Core’s TraceIdentifier, which uniquely identifies each HTTP request. This is essential for correlating errors with server logs.
activityId
Configurator.cs
activityId is extracted from the HTTP activity feature and represents the distributed tracing activity ID. This is particularly useful in microservices architectures where requests span multiple services.
The
activityId follows the W3C Trace Context format (e.g., 00-8d3c5...-01) and integrates with distributed tracing systems like Application Insights, Jaeger, and Zipkin.Customization
The Problem Details customization is configured when you callUseExceptionHandling:
Configurator.cs
Example responses
Not found error
Validation error
Server error
Benefits
- Standardized format: Follows RFC 9457, ensuring compatibility with API clients and tools
- Rich metadata: Includes tracing IDs for debugging and correlation
- Type safety: Strongly-typed responses with consistent structure
- Extensible: Easy to add custom extensions for application-specific data
- Machine-readable: Clients can parse and handle errors programmatically
Related concepts
- Exception handling - Learn how exceptions are converted to Problem Details
- Status code mapping - Understand how the status code is determined