-Added Path to JsonReaderException/JsonSerializationException messages
-Added JsonException -Fixed all Exceptions thrown to be more specific
This commit is contained in:
@@ -184,11 +184,11 @@ namespace Newtonsoft.Json.Linq
|
||||
if (reader.TokenType == JsonToken.None)
|
||||
{
|
||||
if (!reader.Read())
|
||||
throw new Exception("Error reading JConstructor from JsonReader.");
|
||||
throw JsonReaderException.Create(reader, "Error reading JConstructor from JsonReader.");
|
||||
}
|
||||
|
||||
if (reader.TokenType != JsonToken.StartConstructor)
|
||||
throw new Exception("Error reading JConstructor from JsonReader. Current JsonReader item is not a constructor: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));
|
||||
throw JsonReaderException.Create(reader, "Error reading JConstructor from JsonReader. Current JsonReader item is not a constructor: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));
|
||||
|
||||
JConstructor c = new JConstructor((string)reader.Value);
|
||||
c.SetLineInfo(reader as IJsonLineInfo);
|
||||
|
||||
Reference in New Issue
Block a user