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
messagestringDescription 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
messagestringDescription of the deserialisation error.
innerExceptionExceptionThe 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
messagestringDescription of the deserialisation error.
keystringThe HUML key where the error occurred, or
nullwhen there is no enclosing key (e.g. a root-level scalar).lineintThe 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
messagestringDescription of the deserialisation error.
keystringThe HUML key where the error occurred, or
nullwhen there is no enclosing key.lineintThe 1-based line number where the error occurred.
columnintThe 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
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?