YamlException class

Defines a custom exception object that is thrown when invalid YAML text is encountered, when the defined maximum depth is passed, or the YAML text is not compatible with the type of a property on an object.

Namespace: System.Text.Yaml · Assembly: Styml.dll

public class YamlException : Exception

Inheritance: object → Exception → YamlException

Defines a custom exception object that is thrown when invalid YAML text is encountered, when the defined maximum depth is passed, or the YAML text is not compatible with the type of a property on an object.

ConstructorsLink to this heading

Creates a new exception object to relay error information to the user.

public YamlException(string? message, string? path, long? lineNumber, long? bytePositionInLine, Exception? innerException);

Parameters

  • message: The context specific error message.
  • lineNumber: The line number at which the invalid YAML was encountered (starting at 0) when deserializing.
  • bytePositionInLine: The byte count within the current line where the invalid YAML was encountered (starting at 0).
  • path: The path where the invalid YAML was encountered.
  • innerException: The exception that caused the current exception.

Note that the bytePositionInLine counts the number of bytes (i.e. UTF-8 code units) and not characters or scalars.

Creates a new exception object to relay error information to the user.

public YamlException(string? message, string? path, long? lineNumber, long? bytePositionInLine);

Parameters

  • message: The context specific error message.
  • path: The path where the invalid YAML was encountered.
  • lineNumber: The line number at which the invalid YAML was encountered (starting at 0) when deserializing.
  • bytePositionInLine: The byte count within the current line where the invalid YAML was encountered (starting at 0).

Note that the bytePositionInLine counts the number of bytes (i.e. UTF-8 code units) and not characters or scalars.

Creates a new exception object to relay error information to the user.

public YamlException(string? message, Exception? innerException);

Parameters

  • message: The context specific error message.
  • innerException: The exception that caused the current exception.

Creates a new exception object to relay error information to the user.

public YamlException(string? message);

Parameters

  • message: The context specific error message.

Creates a new exception object to relay error information to the user.

public YamlException();

PropertiesLink to this heading

BytePositionInLineLink to this heading

The number of bytes read within the current line before the exception (starting at 0).

public long? BytePositionInLine { get; }

LineNumberLink to this heading

The number of lines read so far before the exception (starting at 0).

public long? LineNumber { get; }

MessageLink to this heading

Gets a message that describes the current exception.

public override string Message { get; }

PathLink to this heading

The path within the YAML where the exception was encountered.

public string? Path { get; }

Generated from the XML documentation of the libraryBuilt with Douze

Esc to close