-Documentation
-Added Path to JsonWriterException
This commit is contained in:
@@ -38,6 +38,12 @@ namespace Newtonsoft.Json
|
||||
#endif
|
||||
public class JsonWriterException : JsonException
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the path to the JSON where the error occurred.
|
||||
/// </summary>
|
||||
/// <value>The path to the JSON where the error occurred.</value>
|
||||
public string Path { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonWriterException"/> class.
|
||||
/// </summary>
|
||||
@@ -79,5 +85,23 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
internal JsonWriterException(string message, Exception innerException, string path)
|
||||
: base(message, innerException)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
|
||||
internal static JsonWriterException Create(JsonWriter writer, string message, Exception ex)
|
||||
{
|
||||
return Create(writer.ContainerPath, message, ex);
|
||||
}
|
||||
|
||||
internal static JsonWriterException Create(string path, string message, Exception ex)
|
||||
{
|
||||
message = FormatExceptionMessage(null, path, message);
|
||||
|
||||
return new JsonWriterException(message, ex, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user