JsSyntaxErrorException Class

The exception thrown when a source text is not a valid script or module (an early error or a syntax error).

public sealed class JsSyntaxErrorException : Exception
Inheritance
Exception JsSyntaxErrorException

Constructors

NameDescription
JsSyntaxErrorException()Initializes a new instance of the JsSyntaxErrorException class.
JsSyntaxErrorException(string)Initializes a new instance of the JsSyntaxErrorException class with a message.
JsSyntaxErrorException(string, Exception)Initializes a new instance of the JsSyntaxErrorException class with a message and an inner exception.
JsSyntaxErrorException(string, string?, int, int, int)Initializes a new instance of the JsSyntaxErrorException class with a message and a location.

JsSyntaxErrorException overloads

JsSyntaxErrorException()

JsSyntaxErrorException.cs

Initializes a new instance of the JsSyntaxErrorException class.

public JsSyntaxErrorException()

JsSyntaxErrorException(string)

JsSyntaxErrorException.cs

Initializes a new instance of the JsSyntaxErrorException class with a message.

public JsSyntaxErrorException(string message)
Parameters
message string

JsSyntaxErrorException(string, Exception)

JsSyntaxErrorException.cs

Initializes a new instance of the JsSyntaxErrorException class with a message and an inner exception.

public JsSyntaxErrorException(string message, Exception innerException)
Parameters
message string
innerException Exception

JsSyntaxErrorException(string, string?, int, int, int)

JsSyntaxErrorException.cs

Initializes a new instance of the JsSyntaxErrorException class with a message and a location.

public JsSyntaxErrorException(string message, string? url, int offset, int line, int column)
Parameters
message string
url string?
offset int
line int
column int

Properties

NameDescription
ColumnGets the 1-based column of the error (in UTF-16 code units).
LineGets the 1-based line of the error.
OffsetGets the offset of the error in the source text.
UrlGets the URL of the source, if any.

Gets the 1-based column of the error (in UTF-16 code units).

public int Column { get; }

Property value

int

Gets the 1-based line of the error.

public int Line { get; }

Property value

int

Gets the offset of the error in the source text.

public int Offset { get; }

Property value

int

Gets the URL of the source, if any.

public string? Url { get; }

Property value

string?