Table of Contents

Class FaultDescriptorOptions

Namespace
Cuemon.AspNetCore.Diagnostics
Assembly
Cuemon.AspNetCore.dll

Specifies options that is related to Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware operations.

public class FaultDescriptorOptions : AsyncOptions, IAsyncOptions, IExceptionDescriptorOptions, IValidatableParameterObject, IParameterObject
Inheritance
Object
FaultDescriptorOptions
Implements
Derived
Inherited Members

Constructors

FaultDescriptorOptions()

Initializes a new instance of the FaultDescriptorOptions class.

public FaultDescriptorOptions()

Remarks

The following table shows the initial property values for an instance of FaultDescriptorOptions.

PropertyInitial Value
ExceptionDescriptorResolverThe default implementation iterates over HttpFaultResolvers until a match is found from an System.Exception; then the associated HttpExceptionDescriptor is returned. If no match is found, a HttpExceptionDescriptor initialized to status 500 InternalServerError is returned
HttpFaultResolversnew List<HttpFaultResolver>();
ExceptionCallbacknull
UseBaseExceptionfalse
RootHelpLinknull
SensitivityDetailsNone
RequestEvidenceProviderrequest => new HttpRequestEvidence(request)

Properties

ExceptionCallback

Gets or sets the callback delegate that is invoked when an exception has been thrown.

public Action<HttpContext, Exception, HttpExceptionDescriptor> ExceptionCallback { get; set; }

Property Value

Action<HttpContext, Exception, HttpExceptionDescriptor>

The delegate that provides a way to interact with captured exceptions.

ExceptionDescriptorResolver

Gets or sets the function delegate that will resolve a HttpExceptionDescriptor from the specified System.Exception.

public Func<Exception, HttpExceptionDescriptor> ExceptionDescriptorResolver { get; set; }

Property Value

Func<Exception, HttpExceptionDescriptor>

The function delegate that will resolve a HttpExceptionDescriptor from the specified System.Exception.

Gets a value indicating whether this instance is initialized with RootHelpLink.

public bool HasRootHelpLink { get; }

Property Value

Boolean

true if this instance is initialized with RootHelpLink; otherwise, false.

HttpFaultResolvers

Gets or sets a collection of HttpFaultResolver that can ease the usage of ExceptionDescriptorResolver.

public IList<HttpFaultResolver> HttpFaultResolvers { get; set; }

Property Value

IList<HttpFaultResolver>

The collection of HttpFaultResolver.

NonMvcResponseHandlers

Gets or sets a collection of HttpExceptionDescriptorResponseHandler that handles exception handling and content negotiation for non-MVC thrown exceptions.

[Obsolete("This property will be removed in near future; feature has been moved to IHttpExceptionDescriptorResponseFormatter and related.")]
public IList<HttpExceptionDescriptorResponseHandler> NonMvcResponseHandlers { get; set; }

Property Value

IList<HttpExceptionDescriptorResponseHandler>

The collection of HttpExceptionDescriptorResponseHandler.

RequestEvidenceProvider

Gets or sets the function delegate that, when SensitivityDetails includes Evidence, provides a default HttpRequestEvidence as part of the serialized result.

public Func<HttpRequest, HttpRequestEvidence> RequestEvidenceProvider { get; set; }

Property Value

Func<HttpRequest, HttpRequestEvidence>

The function delegate that provides a default HttpRequestEvidence as part of the serialized result.

Gets or sets the root link to a help file associated with an API.

public Uri RootHelpLink { get; set; }

Property Value

Uri

The root link to a help file associated with an API.

SensitivityDetails

Gets or sets a bitwise combination of the enumeration values that specify which sensitive details to include in the serialized result.

public FaultSensitivityDetails SensitivityDetails { get; set; }

Property Value

FaultSensitivityDetails

The enumeration values that specify which sensitive details to include in the serialized result.

UseBaseException

Gets or sets a value indicating whether to expose only the base exception that caused the faulted operation.

public bool UseBaseException { get; set; }

Property Value

Boolean

true if only the base exception is exposed; otherwise, false, to include the entire exception tree.

Methods

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.