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
-
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.
Property | Initial Value |
---|---|
ExceptionDescriptorResolver | The default implementation iterates over HttpFaultResolvers until a match is found from an Exception; then the associated HttpExceptionDescriptor is returned. If no match is found, a HttpExceptionDescriptor initialized to status 500 InternalServerError is returned |
HttpFaultResolvers | new List<HttpFaultResolver>(); |
ExceptionCallback | null |
UseBaseException | false |
RootHelpLink | null |
SensitivityDetails | None |
FaultDescriptor | FaultDetails |
RequestEvidenceProvider | request => 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 Exception.
public Func<Exception, HttpExceptionDescriptor> ExceptionDescriptorResolver { get; set; }
Property Value
- Func<Exception, HttpExceptionDescriptor>
The function delegate that will resolve a HttpExceptionDescriptor from the specified Exception.
FaultDescriptor
Gets or sets the preferred fault descriptor to use when serializing exceptions. Default is FaultDetails, e.g., HttpExceptionDescriptor.
public PreferredFaultDescriptor FaultDescriptor { get; set; }
Property Value
- PreferredFaultDescriptor
The preferred fault descriptor to use when serializing exceptions.
HasRootHelpLink
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.
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.
RootHelpLink
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.