Enum PreferredFaultDescriptor
- Namespace
- Cuemon.AspNetCore.Diagnostics
- Assembly
- Cuemon.AspNetCore.dll
Specifies the preferred output format of an Exception raised in the context of either vanilla ASP.NET or ASP.NET MVC.
public enum PreferredFaultDescriptor
Fields
FaultDetails = 0Produces the original format based on HttpExceptionDescriptor.
ProblemDetails = 1Produces machine-readable format for specifying errors in HTTP API responses based on https://tools.ietf.org/html/rfc7807.
Examples
The following example demonstrates how to use the enum to configure the error response format for the FaultDescriptorFilter.
using System;
namespace Cuemon.AspNetCore.Diagnostics;
public static class PreferredFaultDescriptorExample
{
public static void Demonstrate()
{
var preferredFormat = PreferredFaultDescriptor.ProblemDetails;
Console.WriteLine(preferredFormat);
}
}