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
-
ObjectYamlConverter<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
BooleanA value that indicates if the stack of an exception is included in the converted result.
includeData
BooleanA 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
TypeType 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
YamlTextReaderThe reader to read from.
typeToConvert
TypeThe type to convert.
so
YamlSerializerOptionsAn 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
YamlTextWriterThe writer to write to.
value
ExceptionThe value to convert to YAML.
so
YamlSerializerOptionsAn object that specifies serialization options to use.