JsonException Constructeurs

Définition

Surcharges

JsonException()

Initialise une nouvelle instance de la classe JsonException.

JsonException(String)

Initialise une nouvelle instance de la classe JsonException avec un message d'erreur spécifié.

JsonException(SerializationInfo, StreamingContext)
Obsolète.

Crée un objet exception avec des données sérialisées.

JsonException(String, Exception)

Initialise une nouvelle instance de la classe JsonException avec un message d'erreur spécifié et une référence à l'exception interne ayant provoqué cette exception.

JsonException(String, String, Nullable<Int64>, Nullable<Int64>)

Crée un nouvel objet d’exception pour relayer les informations de l’erreur à l’utilisateur.

JsonException(String, String, Nullable<Int64>, Nullable<Int64>, Exception)

Crée un objet exception pour relayer les informations de l’erreur à l’utilisateur, qui incluent une exception interne spécifiée.

JsonException()

Source:
JsonException.cs
Source:
JsonException.cs
Source:
JsonException.cs

Initialise une nouvelle instance de la classe JsonException.

public:
 JsonException();
public JsonException ();
Public Sub New ()

S’applique à

JsonException(String)

Source:
JsonException.cs
Source:
JsonException.cs
Source:
JsonException.cs

Initialise une nouvelle instance de la classe JsonException avec un message d'erreur spécifié.

public:
 JsonException(System::String ^ message);
public JsonException (string? message);
public JsonException (string message);
new System.Text.Json.JsonException : string -> System.Text.Json.JsonException
Public Sub New (message As String)

Paramètres

message
String

Message d’erreur spécifique au contexte.

S’applique à

JsonException(SerializationInfo, StreamingContext)

Source:
JsonException.cs
Source:
JsonException.cs
Source:
JsonException.cs

Attention

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Crée un objet exception avec des données sérialisées.

protected:
 JsonException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected JsonException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected JsonException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Text.Json.JsonException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Text.Json.JsonException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Text.Json.JsonException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Text.Json.JsonException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Paramètres

info
SerializationInfo

Données d'objet sérialisées sur l'exception levée.

context
StreamingContext

Objet qui contient des informations contextuelles sur la source ou la destination.

Attributs

Exceptions

info est null.

S’applique à

JsonException(String, Exception)

Source:
JsonException.cs
Source:
JsonException.cs
Source:
JsonException.cs

Initialise une nouvelle instance de la classe JsonException avec un message d'erreur spécifié et une référence à l'exception interne ayant provoqué cette exception.

public:
 JsonException(System::String ^ message, Exception ^ innerException);
public JsonException (string? message, Exception? innerException);
public JsonException (string message, Exception innerException);
new System.Text.Json.JsonException : string * Exception -> System.Text.Json.JsonException
Public Sub New (message As String, innerException As Exception)

Paramètres

message
String

Message d’erreur spécifique au contexte.

innerException
Exception

Exception à l'origine de l'exception actuelle.

S’applique à

JsonException(String, String, Nullable<Int64>, Nullable<Int64>)

Source:
JsonException.cs
Source:
JsonException.cs
Source:
JsonException.cs

Crée un nouvel objet d’exception pour relayer les informations de l’erreur à l’utilisateur.

public:
 JsonException(System::String ^ message, System::String ^ path, Nullable<long> lineNumber, Nullable<long> bytePositionInLine);
public JsonException (string? message, string? path, long? lineNumber, long? bytePositionInLine);
public JsonException (string message, string path, long? lineNumber, long? bytePositionInLine);
new System.Text.Json.JsonException : string * string * Nullable<int64> * Nullable<int64> -> System.Text.Json.JsonException
Public Sub New (message As String, path As String, lineNumber As Nullable(Of Long), bytePositionInLine As Nullable(Of Long))

Paramètres

message
String

Message d’erreur spécifique au contexte.

path
String

Chemin où le texte JSON non valide a été trouvé.

lineNumber
Nullable<Int64>

Numéro de ligne (commençant à 0) auquel le texte JSON non valide a été trouvé lors de la désérialisation.

bytePositionInLine
Nullable<Int64>

Nombre d’octets dans la ligne actuelle (commençant à 0) où le texte JSON non valide a été trouvé.

Remarques

Notez que bytePositionInLine compte le nombre d’octets (c’est-à-dire les unités de code UTF-8), et non de caractères ou de scalaires.

S’applique à

JsonException(String, String, Nullable<Int64>, Nullable<Int64>, Exception)

Source:
JsonException.cs
Source:
JsonException.cs
Source:
JsonException.cs

Crée un objet exception pour relayer les informations de l’erreur à l’utilisateur, qui incluent une exception interne spécifiée.

public:
 JsonException(System::String ^ message, System::String ^ path, Nullable<long> lineNumber, Nullable<long> bytePositionInLine, Exception ^ innerException);
public JsonException (string? message, string? path, long? lineNumber, long? bytePositionInLine, Exception? innerException);
public JsonException (string message, string path, long? lineNumber, long? bytePositionInLine, Exception innerException);
new System.Text.Json.JsonException : string * string * Nullable<int64> * Nullable<int64> * Exception -> System.Text.Json.JsonException
Public Sub New (message As String, path As String, lineNumber As Nullable(Of Long), bytePositionInLine As Nullable(Of Long), innerException As Exception)

Paramètres

message
String

Message d’erreur spécifique au contexte.

path
String

Chemin où le texte JSON non valide a été trouvé.

lineNumber
Nullable<Int64>

Numéro de ligne (commençant à 0) auquel le texte JSON non valide a été trouvé lors de la désérialisation.

bytePositionInLine
Nullable<Int64>

Nombre d’octets (commençant à 0) dans la ligne actuelle où le texte JSON non valide a été trouvé.

innerException
Exception

Exception à l'origine de l'exception actuelle.

Remarques

Notez que le bytePositionInLine compte le nombre d’octets (c’est-à-dire les unités de code UTF-8), et non les caractères ou scalaires.

S’applique à