RobotsParseError Class

Describes a single non-fatal parse error encountered while reading a robots.txt file.

public sealed class RobotsParseError

Remarks

The parser is lenient and always skips lines it cannot interpret, but each skipped or unrecognised line is recorded as a RobotsParseError in RobotsFile.ParseErrors so callers can audit file quality.

Constructors

NameDescription
RobotsParseError(int, string, RobotsParseErrorKind)

RobotsParseError(int, string, RobotsParseErrorKind)

RobotsParseError.cs
public RobotsParseError(int lineNumber, string line, RobotsParseErrorKind kind)

Parameters

lineNumber int
line string
kind RobotsParseErrorKind

No documentation is available.

Properties

NameDescription
KindGets the kind of error that was detected.
LineGets the raw text of the offending line (before comment stripping and whitespace trimming).
LineNumberGets the 1-based line number where the error occurred.

Gets the kind of error that was detected.

public RobotsParseErrorKind Kind { get; }

Property value

RobotsParseErrorKind

Gets the raw text of the offending line (before comment stripping and whitespace trimming).

public string Line { get; }

Property value

string

Gets the 1-based line number where the error occurred.

public int LineNumber { get; }

Property value

int

Methods

NameDescription
ToString()Returns a string that represents the current object.

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.