Class HumlDeserializeException

Namespace
Huml.Net.Exceptions
Assembly
Huml.Net.dll

Thrown when an error occurs during HUML deserialisation.

public sealed class HumlDeserializeException : Exception, ISerializable
Inheritance
HumlDeserializeException
Implements
Inherited Members

Remarks

When Key and Line are set, they provide diagnostic information about which HUML key and document line caused the failure.

Constructors

HumlDeserializeException(string)

Initialises a new instance with an error message.

public HumlDeserializeException(string message)

Parameters

message string

Description of the deserialisation error.

HumlDeserializeException(string, Exception)

Initialises a new instance with an error message and a reference to the inner exception.

public HumlDeserializeException(string message, Exception innerException)

Parameters

message string

Description of the deserialisation error.

innerException Exception

The exception that caused the current exception (e.g. one thrown by a user constructor or property setter).

HumlDeserializeException(string, string?, int)

Initialises a new instance with a diagnostic message, optional key, and line number. When key is non-null the formatted message is [line {line}] Key '{key}': {message}; when null the message is emitted as-is.

[Obsolete("Use the four-argument constructor that includes column.", false)]
public HumlDeserializeException(string message, string? key, int line)

Parameters

message string

Description of the deserialisation error.

key string

The HUML key where the error occurred, or null when there is no enclosing key (e.g. a root-level scalar).

line int

The 1-based line number where the error occurred.

HumlDeserializeException(string, string?, int, int)

Initialises a new instance with a diagnostic message, optional key, line number, and column position. When key is non-null the formatted message is [line {line}, col {column}] Key '{key}': {message}; when null the message is emitted as-is.

public HumlDeserializeException(string message, string? key, int line, int column)

Parameters

message string

Description of the deserialisation error.

key string

The HUML key where the error occurred, or null when there is no enclosing key.

line int

The 1-based line number where the error occurred.

column int

The 0-based column position where the error occurred.

Properties

Column

The 0-based column position in the HUML document where the error was detected, or null when no column context is available.

public int? Column { get; }

Property Value

int?

Key

The HUML key associated with the error, or null when no key context is available.

public string? Key { get; }

Property Value

string

Line

The 1-based line number in the HUML document where the error was detected, or null when no line context is available.

public int? Line { get; }

Property Value

int?