Table of Contents

Class SvgException

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

Thrown when an SVG file is not well-formed XML, breaks a safety limit, or, with Strict, has anything a lenient load would skip.

public sealed class SvgException : EgamiException, ISerializable
Inheritance
SvgException
Implements
Inherited Members

Examples

// Strict turns everything a lenient load would skip into an exception with the line and column.
try
{
    SvgDocument.Parse("<svg>\n  <rect width='10' height='10'/>\n</svg>", new SvgLoadOptions { Strict = true });
}
catch (SvgException e)
{
    Console.WriteLine($"Line {e.Line}, column {e.Column}: {e.Problem}");
}

Constructors

SvgException(int, int, string, Exception?)

Initializes a new instance of the SvgException class.

public SvgException(int line, int column, string problem, Exception? innerException = null)

Parameters

line int

The 1-based line of the problem in the file, or 0 if unknown.

column int

The 1-based column of the problem, or 0 if unknown.

problem string

What is wrong, as a sentence.

innerException Exception

The exception that caused this one, if any.

Properties

Column

Gets the 1-based column of the problem, or 0 if unknown.

public int Column { get; }

Property Value

int

Line

Gets the 1-based line of the problem in the file, or 0 if unknown.

public int Line { get; }

Property Value

int

Problem

Gets what is wrong, as a sentence.

public string Problem { get; }

Property Value

string