Table of Contents

ExceptionDescriptorOptions Class

Definition

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.

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

// 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

Name Description
ExceptionDescriptorOptions()

Initializes a new instance of the ExceptionDescriptorOptions class.

Properties

Name Description
SensitivityDetails

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