Table of Contents

PreferredFaultDescriptor Enum

Definition

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 = 0

Produces the original format based on HttpExceptionDescriptor.

ProblemDetails = 1

Produces 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);
    }
}