Skip to content

JsonException

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: JsonException.cs

Represents errors that occur during JSON parsing, reading, or writing operations. This exception is thrown when invalid JSON text is encountered, when the defined maximum depth is exceeded, or when the JSON text is not compatible with the type of a property on an object.

public class JsonException : Exception, ISerializable

Inheritance

ObjectExceptionJsonException

Implements

ISerializable

Constructors

Constructor Description
JsonException(...) Initializes a new instance of the JsonException class with a specified error message, path, line number, byte position, and a reference to the inner...

Properties

Property Type Description
BytePositionInLine Nullable<long> Gets the number of bytes read within the current line before the exception (starting at 0).
LineNumber Nullable<long> Gets the number of lines read so far before the exception (starting at 0).
Message string Gets a message that describes the current exception.
Path string Gets the path within the JSON where the exception was encountered.

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