Class InvalidJsonException | Package Manager UI website
docs.unity.cn
    Show / Hide Table of Contents

    Class InvalidJsonException

    The exception that is thrown when json input is invalid.

    Inheritance
    System.Object
    System.Exception
    InvalidJsonException
    Namespace: Unity.Serialization.Json
    Syntax
    [Serializable]
    public class InvalidJsonException : Exception, ISerializable, _Exception

    Constructors

    InvalidJsonException(SerializationInfo, StreamingContext)

    Initializes a new instance of the InvalidJsonException class with serialized data.

    Declaration
    protected InvalidJsonException(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.

    InvalidJsonException(String)

    Initialized a new instance of the InvalidJsonException class with a specified error message.

    Declaration
    public InvalidJsonException(string message)
    Parameters
    Type Name Description
    System.String message

    The message that describes the error.

    InvalidJsonException(String, Exception)

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

    Declaration
    public InvalidJsonException(string message, Exception inner)
    Parameters
    Type Name Description
    System.String message

    The message that describes the error.

    System.Exception inner

    The inner exception reference.

    Properties

    Character

    The character the validator stopped at.

    Declaration
    public int Character { get; set; }
    Property Value
    Type Description
    System.Int32

    Line

    The line the validator stopped at.

    Declaration
    public int Line { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    GetObjectData(SerializationInfo, StreamingContext)

    Sets the System.Runtime.Serialization.SerializationInfo with information about the exception.

    Declaration
    [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
    public override void GetObjectData(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.

    Overrides
    System.Exception.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
    Exceptions
    Type Condition
    System.ArgumentNullException

    The info parameter is a null reference

    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX