TomlSerializationException Class
Definition
- Assembly
- Bodu.Text.Toml.dll
- Package
- Bodu.Text.Toml 1.0.0
The exception thrown when a value cannot be bound to or from a TOML document during serialization - for example a type mismatch, a missing required member, or a value TOML cannot represent.
public sealed class TomlSerializationException : Exception, ISerializable
- Inheritance
-
TomlSerializationException
- Implements
- Inherited Members
- Extension Methods
Remarks
This exception reports a binding-level failure and is distinct from TomlFormatException, which reports that the source text was not well-formed TOML. 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
TomlSerializationException()
Initializes a new instance of the TomlSerializationException class.
public TomlSerializationException()
TomlSerializationException(string)
Initializes a new instance of the TomlSerializationException class with the specified message.
public TomlSerializationException(string message)
Parameters
messagestringThe message that describes the error.
TomlSerializationException(string, Exception?)
Initializes a new instance of the TomlSerializationException class with the specified message and a reference to the inner exception that caused it.
public TomlSerializationException(string message, Exception? innerException)
Parameters
TomlSerializationException(string, int)
Initializes a new instance of the TomlSerializationException class with the specified message and source offset.
public TomlSerializationException(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 |