Skip to content

JsonException Constructors

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll

Overloads

Constructor Description
JsonException(string, string, Nullable<long>, Nullable<long>, Exception) Initializes a new instance of the JsonException class with a specified error message, path, line number, byte position, and a reference to the inner...
JsonException(string, string, Nullable<long>, Nullable<long>) Initializes a new instance of the JsonException class with a specified error message, path, line number, and byte position.
JsonException(string, Exception) Initializes a new instance of the JsonException class with a specified error message and a reference to the inner exception that is the cause of thi...
JsonException(string) Initializes a new instance of the JsonException class with a specified error message.
JsonException() Initializes a new instance of the JsonException class.

JsonException(string, string, Nullable<long>, Nullable<long>, Exception)

Source: JsonException.cs

Initializes a new instance of the JsonException class with a specified error message, path, line number, byte position, and a reference to the inner exception that is the cause of this exception.

public JsonException(string message, string path, Nullable<long> lineNumber, Nullable<long> bytePositionInLine, Exception innerException)

Parameters

Name Type Description
message string The context specific error message.
path string The path where the invalid JSON was encountered.
lineNumber Nullable<long> The line number at which the invalid JSON was encountered (starting at 0) when deserializing.
bytePositionInLine Nullable<long> The byte count within the current line where the invalid JSON was encountered (starting at 0).
innerException Exception The exception that caused the current exception.

Remarks

Note that the bytePositionInLine counts the number of bytes (i.e. UTF-8 code units) and not characters or scalars.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

JsonException(string, string, Nullable<long>, Nullable<long>)

Source: JsonException.cs

Initializes a new instance of the JsonException class with a specified error message, path, line number, and byte position.

public JsonException(string message, string path, Nullable<long> lineNumber, Nullable<long> bytePositionInLine)

Parameters

Name Type Description
message string The context specific error message.
path string The path where the invalid JSON was encountered.
lineNumber Nullable<long> The line number at which the invalid JSON was encountered (starting at 0) when deserializing.
bytePositionInLine Nullable<long> The byte count within the current line where the invalid JSON was encountered (starting at 0).

Remarks

Note that the bytePositionInLine counts the number of bytes (i.e. UTF-8 code units) and not characters or scalars.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

JsonException(string, Exception)

Source: JsonException.cs

Initializes a new instance of the JsonException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public JsonException(string message, Exception innerException)

Parameters

Name Type Description
message string The context specific error message.
innerException Exception The exception that caused the current exception.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

JsonException(string)

Source: JsonException.cs

Initializes a new instance of the JsonException class with a specified error message.

public JsonException(string message)

Parameters

Name Type Description
message string The context specific error message.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

JsonException()

Source: JsonException.cs

Initializes a new instance of the JsonException class.

public JsonException()

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue