YamlSerializationException Class
Definition
- Assembly
- Bodu.Text.Yaml.dll
- Package
- Bodu.Text.Yaml 1.0.0
The exception thrown when a value cannot be bound to or from a YAML document during serialization - for example a type mismatch, a missing required member, or a value YAML cannot represent.
public sealed class YamlSerializationException : Exception, ISerializable
- Inheritance
-
YamlSerializationException
- Implements
- Inherited Members
- Extension Methods
Remarks
This exception reports a binding-level failure and is distinct from YamlFormatException, which reports that the source text was not well-formed YAML. When the failure can be traced to a member, the Path carries the dotted path to it; when it can be traced to a position in the source, the Offset, LineNumber, and ColumnNumber carry the position.
Constructors
YamlSerializationException()
Initializes a new instance of the YamlSerializationException class.
public YamlSerializationException()
YamlSerializationException(string)
Initializes a new instance of the YamlSerializationException class with the specified message.
public YamlSerializationException(string message)
Parameters
messagestringThe message that describes the error.
YamlSerializationException(string, Exception?)
Initializes a new instance of the YamlSerializationException class with the specified message and a reference to the inner exception that caused it.
public YamlSerializationException(string message, Exception? innerException)
Parameters
YamlSerializationException(string, int)
Initializes a new instance of the YamlSerializationException class with the specified message and source offset.
public YamlSerializationException(string message, int offset)
Parameters
Properties
ColumnNumber
Gets the 1-based column number, in UTF-8 bytes from the start of the line, at which the error was detected, when available.
public int? ColumnNumber { get; }
Property Value
LineNumber
Gets the 1-based line number in the source at which the error was detected, when available.
public int? LineNumber { get; }
Property Value
Offset
Gets the byte offset into the source at which the error was detected, when available.
public int? Offset { get; }
Property Value
Path
Gets the dotted path to the member whose binding failed, for example server.endpoints[0].timeout, when
available.
public string? Path { get; }
Property Value
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |