JsonException Konstruktorer

Definition

Överlagringar

Name Description
JsonException()

Initierar en ny instans av JsonException klassen.

JsonException(String)

Initierar en ny instans av JsonException klassen med ett angivet felmeddelande.

JsonException(SerializationInfo, StreamingContext)
Föråldrad.

Skapar ett nytt undantagsobjekt med serialiserade data.

JsonException(String, Exception)

Initierar en ny instans av JsonException klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget.

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

Skapar ett nytt undantagsobjekt för att vidarebefordra felinformation till användaren.

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

Skapar ett nytt undantagsobjekt för att vidarebefordra felinformation till användaren som innehåller ett angivet inre undantag.

JsonException()

Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs

Initierar en ny instans av JsonException klassen.

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

Gäller för

JsonException(String)

Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs

Initierar en ny instans av JsonException klassen med ett angivet felmeddelande.

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)

Parametrar

message
String

Det kontextspecifika felmeddelandet.

Gäller för

JsonException(SerializationInfo, StreamingContext)

Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs

Varning

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

Skapar ett nytt undantagsobjekt med serialiserade data.

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);
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}")>]
new System.Text.Json.JsonException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Text.Json.JsonException
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)

Parametrar

info
SerializationInfo

Serialiserade objektdata om undantaget som genereras.

context
StreamingContext

Ett objekt som innehåller kontextuell information om källan eller målet.

Attribut

Undantag

info är null.

Gäller för

JsonException(String, Exception)

Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs

Initierar en ny instans av JsonException klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget.

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)

Parametrar

message
String

Det kontextspecifika felmeddelandet.

innerException
Exception

Undantaget som orsakade det aktuella undantaget.

Gäller för

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

Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs

Skapar ett nytt undantagsobjekt för att vidarebefordra felinformation till användaren.

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))

Parametrar

message
String

Det kontextspecifika felmeddelandet.

path
String

Sökvägen där den ogiltiga JSON-filen påträffades.

lineNumber
Nullable<Int64>

Radnumret (börjar vid 0) där den ogiltiga JSON påträffades vid deserialisering.

bytePositionInLine
Nullable<Int64>

Byteantalet inom den aktuella raden (från och med 0) där den ogiltiga JSON påträffades.

Kommentarer

Observera att bytePositionInLine räknar antalet byte (dvs. UTF-8-kodenheter) och inte tecken eller skalärer.

Gäller för

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

Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs
Källa:
JsonException.cs

Skapar ett nytt undantagsobjekt för att vidarebefordra felinformation till användaren som innehåller ett angivet inre undantag.

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)

Parametrar

message
String

Det kontextspecifika felmeddelandet.

path
String

Sökvägen där den ogiltiga JSON-filen påträffades.

lineNumber
Nullable<Int64>

Radnumret (börjar vid 0) där den ogiltiga JSON påträffades vid deserialisering.

bytePositionInLine
Nullable<Int64>

Byteantalet (börjar vid 0) inom den aktuella raden där den ogiltiga JSON påträffades.

innerException
Exception

Undantaget som orsakade det aktuella undantaget.

Kommentarer

Observera att bytePositionInLine räknar antalet byte (dvs. UTF-8-kodenheter) och inte tecken eller skalär.

Gäller för