Table of Contents

Class ExceptionDescriptorOptions

Namespace
Cuemon.Diagnostics
Assembly
Cuemon.Core.dll

Specifies options that is related to ExceptionDescriptor operations.

public class ExceptionDescriptorOptions : IExceptionDescriptorOptions, IParameterObject
Inheritance
ExceptionDescriptorOptions
Implements

Examples

The following example demonstrates how to configure to control which sensitive details are included in serialized exception descriptors.

using System;
using Cuemon.Diagnostics; // for ExceptionDescriptorOptions, FaultSensitivityDetails

namespace MyApp.Examples;

public class ExceptionDescriptorOptionsExample
{
    public void Demonstrate()
    {
        // Create options that include only the stack trace
        var options = new ExceptionDescriptorOptions
        {
            SensitivityDetails = FaultSensitivityDetails.StackTrace
        };
        Console.WriteLine(options.SensitivityDetails); // StackTrace

        // Create options that include stack trace and exception data
        var verbose = new ExceptionDescriptorOptions
        {
            SensitivityDetails =
                FaultSensitivityDetails.StackTrace |
                FaultSensitivityDetails.Data
        };

        // Verify flags are set
        bool hasStack = verbose.SensitivityDetails.HasFlag(FaultSensitivityDetails.StackTrace);
        bool hasData = verbose.SensitivityDetails.HasFlag(FaultSensitivityDetails.Data);
        Console.WriteLine(hasStack); // True
        Console.WriteLine(hasData);  // True

        // Default is none
        var defaults = new ExceptionDescriptorOptions();
        Console.WriteLine(defaults.SensitivityDetails); // None

}
}

Constructors

ExceptionDescriptorOptions()

Initializes a new instance of the ExceptionDescriptorOptions class.

public ExceptionDescriptorOptions()

Remarks

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

PropertyInitial Value
SensitivityDetailsNone

Properties

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.