Table of Contents

Class MarkupException

Namespace
Icy.Markup
Assembly
IcyUI.dll

The exception raised for every markup error - a malformed document, an unresolvable type or property, a bad value, or a structural rule the document broke.

public class MarkupException : Exception, ISerializable
Inheritance
MarkupException
Implements
Inherited Members
Extension Methods

Remarks

Loading fails on the first error and never returns a partially-constructed tree, so a caught MarkupException always means nothing was produced.

Message is prefixed with the source position in the standard compiler format (path(line,column): message) whenever the loader knows it, which it does for anything anchored to a node, since documents are parsed with SetLineInfo.

Constructors

MarkupException(string, string?, int, int, Exception?)

Initializes a new instance of the MarkupException class.

public MarkupException(string message, string? sourcePath = null, int line = 0, int column = 0, Exception? innerException = null)

Parameters

message string

A description of what went wrong.

sourcePath string

The path of the markup file, or null when it isn't known.

line int

The 1-based line the error occurred on, or 0 when it isn't known.

column int

The 1-based column the error occurred on, or 0 when it isn't known.

innerException Exception

The underlying exception, when this error wraps one.

Properties

Column

Gets the 1-based column the error occurred on, or 0 when it isn't known.

public int Column { get; }

Property Value

int

Description

Gets the error description without the source-position prefix that Message carries.

public string Description { get; }

Property Value

string

Line

Gets the 1-based line the error occurred on, or 0 when it isn't known.

public int Line { get; }

Property Value

int

SourcePath

Gets the path of the markup file the error occurred in, or null when it isn't known.

public string? SourcePath { get; }

Property Value

string

Methods

At(string, IXmlLineInfo?, string?, Exception?)

Creates an exception anchored at the position of an XML node.

public static MarkupException At(string message, IXmlLineInfo? node, string? sourcePath, Exception? innerException = null)

Parameters

message string

A description of what went wrong.

node IXmlLineInfo

The node the error is about; its line info is used when it has any.

sourcePath string

The path of the markup file, or null when it isn't known.

innerException Exception

The underlying exception, when this error wraps one.

Returns

MarkupException

An exception carrying node's position.