ParserError ParserError ParserError ParserError Class

Definition

Represents a parser error or warning. This class cannot be inherited.

public ref class ParserError sealed
[System.Serializable]
public sealed class ParserError
type ParserError = class
Public NotInheritable Class ParserError
Inheritance
ParserErrorParserErrorParserErrorParserError
Attributes

Examples

The following code example demonstrates how to add a new parser error to a ParserErrorCollection object.

// Add a ParserError to the collection.
collection.Add(new ParserError("ErrorName", "Path", 1));
' Add a ParserError to the collection.
collection.Add(New ParserError("ErrorName", "Path", 1))

Remarks

A ParserError object represents an error that is created when an HttpParseException exception is thrown. A parser error object can contain error message text, a virtual path to the file where the error occurred, and the subsequent line number of the error in that file. If more than one parser error occurs or you want to store multiple parser errors in a centralized location, use the ParserErrorCollection object.

A parser error is of the type HttpException. For more information on exceptions and how to handle them, go to MSDN Library.

Constructors

ParserError() ParserError() ParserError() ParserError()

Initializes a new instance of the ParserError class.

ParserError(String, String, Int32) ParserError(String, String, Int32) ParserError(String, String, Int32) ParserError(String, String, Int32)

Initializes a new instance of the ParserError class by using the specified error text, virtual path, and source line number.

Properties

ErrorText ErrorText ErrorText ErrorText

Gets or sets a string that represents the error for the ParserError object.

Line Line Line Line

Gets or sets the line number of the source at which the error occurs.

VirtualPath VirtualPath VirtualPath VirtualPath

Gets or set the virtual path of the file that was being parsed when the error occurred.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also