JsonWriterException
The exception thrown when an error occurs while writing JSON text.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace Newtonsoft.Json
{
[Serializable]
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public class JsonWriterException : JsonException
{
[System.Runtime.CompilerServices.Nullable(2)]
[field: System.Runtime.CompilerServices.Nullable(2)]
public string Path {
[System.Runtime.CompilerServices.NullableContext(2)]
get;
}
public JsonWriterException()
{
}
public JsonWriterException(string message)
: base(message)
{
}
public JsonWriterException(string message, Exception innerException)
: base(message, innerException)
{
}
public JsonWriterException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public JsonWriterException(string message, string path, [System.Runtime.CompilerServices.Nullable(2)] Exception innerException)
: base(message, innerException)
{
Path = path;
}
internal static JsonWriterException Create(JsonWriter writer, string message, [System.Runtime.CompilerServices.Nullable(2)] Exception ex)
{
return Create(writer.ContainerPath, message, ex);
}
internal static JsonWriterException Create(string path, string message, [System.Runtime.CompilerServices.Nullable(2)] Exception ex)
{
message = JsonPosition.FormatMessage(null, path, message);
return new JsonWriterException(message, path, ex);
}
}
}