<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

JsonReaderException

The exception thrown when an error occurs while reading JSON text.
using System; using System.Runtime.CompilerServices; namespace Newtonsoft.Json { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public class JsonReaderException : JsonException { public int LineNumber { get; } public int LinePosition { get; } [System.Runtime.CompilerServices.Nullable(2)] [field: System.Runtime.CompilerServices.Nullable(2)] public string Path { [System.Runtime.CompilerServices.NullableContext(2)] get; } public JsonReaderException() { } public JsonReaderException(string message) : base(message) { } public JsonReaderException(string message, Exception innerException) : base(message, innerException) { } public JsonReaderException(string message, string path, int lineNumber, int linePosition, [System.Runtime.CompilerServices.Nullable(2)] Exception innerException) : base(message, innerException) { Path = path; LineNumber = lineNumber; LinePosition = linePosition; } internal static JsonReaderException Create(JsonReader reader, string message) { return Create(reader, message, null); } internal static JsonReaderException Create(JsonReader reader, string message, [System.Runtime.CompilerServices.Nullable(2)] Exception ex) { return Create(reader as IJsonLineInfo, reader.Path, message, ex); } internal static JsonReaderException Create([System.Runtime.CompilerServices.Nullable(2)] IJsonLineInfo lineInfo, string path, string message, [System.Runtime.CompilerServices.Nullable(2)] Exception ex) { message = JsonPosition.FormatMessage(lineInfo, path, message); int lineNumber; int linePosition; if (lineInfo != null && lineInfo.HasLineInfo()) { lineNumber = lineInfo.LineNumber; linePosition = lineInfo.LinePosition; } else { lineNumber = 0; linePosition = 0; } return new JsonReaderException(message, path, lineNumber, linePosition, ex); } } }