Class JsonReaderException
The exception thrown when an error occurs while reading JSON text.
Implements
Inherited Members
Namespace: Bayat.Json
Assembly: Bayat.Json.Runtime.dll
Syntax
[Serializable]
public class JsonReaderException : JsonException, _Exception, ISerializable
Constructors
| Improve this Doc View SourceJsonReaderException()
Initializes a new instance of the JsonReaderException class.
Declaration
public JsonReaderException()
JsonReaderException(SerializationInfo, StreamingContext)
Initializes a new instance of the JsonReaderException class.
Declaration
public JsonReaderException(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown. |
System.Runtime.Serialization.StreamingContext | context | The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.Runtime.Serialization.SerializationException | The class name is null or System.Exception.HResult is zero (0). |
JsonReaderException(String)
Initializes a new instance of the JsonReaderException class with a specified error message.
Declaration
public JsonReaderException(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The error message that explains the reason for the exception. |
JsonReaderException(String, Exception)
Initializes a new instance of the JsonReaderException class with a specified error message and a reference to the inner exception that is the cause of this exception.
Declaration
public JsonReaderException(string message, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The error message that explains the reason for the exception. |
System.Exception | innerException | The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. |
JsonReaderException(String, Exception, String, Int32, Int32)
Declaration
public JsonReaderException(string message, Exception innerException, string path, int lineNumber, int linePosition)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | |
System.Exception | innerException | |
System.String | path | |
System.Int32 | lineNumber | |
System.Int32 | linePosition |
Properties
| Improve this Doc View SourceLineNumber
Gets the line number indicating where the error occurred.
Declaration
public int LineNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The line number indicating where the error occurred. |
LinePosition
Gets the line position indicating where the error occurred.
Declaration
public int LinePosition { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The line position indicating where the error occurred. |
Path
Gets the path to the JSON where the error occurred.
Declaration
public string Path { get; }
Property Value
Type | Description |
---|---|
System.String | The path to the JSON where the error occurred. |
Methods
| Improve this Doc View SourceCreate(IJsonLineInfo, String, String, Exception)
Declaration
public static JsonReaderException Create(IJsonLineInfo lineInfo, string path, string message, Exception ex)
Parameters
Type | Name | Description |
---|---|---|
IJsonLineInfo | lineInfo | |
System.String | path | |
System.String | message | |
System.Exception | ex |
Returns
Type | Description |
---|---|
JsonReaderException |
Create(JsonReader, String)
Declaration
public static JsonReaderException Create(JsonReader reader, string message)
Parameters
Type | Name | Description |
---|---|---|
JsonReader | reader | |
System.String | message |
Returns
Type | Description |
---|---|
JsonReaderException |
Create(JsonReader, String, Exception)
Declaration
public static JsonReaderException Create(JsonReader reader, string message, Exception ex)
Parameters
Type | Name | Description |
---|---|---|
JsonReader | reader | |
System.String | message | |
System.Exception | ex |
Returns
Type | Description |
---|---|
JsonReaderException |