Table of Contents

Class ExceptionConverter

Namespace
Cuemon.Text.Yaml.Converters
Assembly
Cuemon.Core.dll

Converts an System.Exception to or from YAML.

[Obsolete("All YAML marshalling has been moved to its own assembly; Cuemon.Extensions.YamlDotNet. This member will be removed with next major version.")]
public class ExceptionConverter : YamlConverter<Exception>
Inheritance
Object
YamlConverter<Exception>
ExceptionConverter
Extension Methods

Constructors

ExceptionConverter(Boolean, Boolean)

Initializes a new instance of the ExceptionConverter class.

public ExceptionConverter(bool includeStackTrace = false, bool includeData = false)

Parameters

includeStackTrace Boolean

A value that indicates if the stack of an exception is included in the converted result.

includeData Boolean

A value that indicates if the data of an exception is included in the converted result.

Properties

IncludeData

Gets a value indicating whether the data of an exception is included in the converted result.

public bool IncludeData { get; }

Property Value

Boolean

true if the data of an exception is included in the converted result; otherwise, false.

IncludeStackTrace

Gets a value indicating whether the stack of an exception is included in the converted result.

public bool IncludeStackTrace { get; }

Property Value

Boolean

true if the stack of an exception is included in the converted result; otherwise, false.

Methods

CanConvert(Type)

Determines whether this instance can convert the specified object type.

public override bool CanConvert(Type typeToConvert)

Parameters

typeToConvert Type

Type of the object.

Returns

Boolean

true if this instance can convert the specified object type; otherwise, false.

ReadYaml(YamlTextReader, Type, YamlSerializerOptions)

Reads and converts the YAML to System.Exception.

public override Exception ReadYaml(YamlTextReader reader, Type typeToConvert, YamlSerializerOptions so)

Parameters

reader YamlTextReader

The reader to read from.

typeToConvert Type

The type to convert.

so YamlSerializerOptions

An object that specifies serialization options to use.

Returns

Exception

The converted value.

Exceptions

System.NotImplementedException

WriteYaml(YamlTextWriter, Exception, YamlSerializerOptions)

Writes a specified value as YAML.

public override void WriteYaml(YamlTextWriter writer, Exception value, YamlSerializerOptions so)

Parameters

writer YamlTextWriter

The writer to write to.

value Exception

The value to convert to YAML.

so YamlSerializerOptions

An object that specifies serialization options to use.

See Also