ScriptError Class

The information of an exception reported by the library (https://html.spec.whatwg.org/multipage/webappapis.html#extract-error): the attributes of the ErrorEvent fired at the window.

public sealed class ScriptError

Constructors

NameDescription
ScriptError(string, object?)Creates the information of an exception.

ScriptError(string, object?)

ScriptError.cs

Creates the information of an exception.

public ScriptError(string message, object? error)

Parameters

message string
The message of the error.
error object?
The exception value (the error attribute of the ErrorEvent): a value of the script engine, or a .NET exception.

Properties

NameDescription
ColumnNumberGets the column number where the error occurred (1-based), or 0.
ErrorGets the exception value: a value of the script engine, or a .NET exception. It is null for a muted error (the error attribute of the ErrorEvent is then null).
FilenameGets the URL of the script where the error occurred, or an empty string.
LineNumberGets the line number where the error occurred (1-based), or 0.
MessageGets the message of the error.

ColumnNumber

ScriptError.cs

Gets the column number where the error occurred (1-based), or 0.

public int ColumnNumber { get; init; }

Property value

int

Gets the exception value: a value of the script engine, or a .NET exception. It is null for a muted error (the error attribute of the ErrorEvent is then null).

public object? Error { get; }

Property value

object?

Gets the URL of the script where the error occurred, or an empty string.

public string Filename { get; init; }

Property value

string

LineNumber

ScriptError.cs

Gets the line number where the error occurred (1-based), or 0.

public int LineNumber { get; init; }

Property value

int

Gets the message of the error.

public string Message { get; }

Property value

string

Methods

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

ToString()

ScriptError.cs

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.