-Added Path to JsonReaderException/JsonSerializationException messages

-Added JsonException
-Fixed all Exceptions thrown to be more specific
This commit is contained in:
James Newton-King
2012-04-21 17:25:44 +12:00
parent c120bf530d
commit a7bddf989f
69 changed files with 1400 additions and 1161 deletions
+2 -2
View File
@@ -188,7 +188,7 @@ namespace Newtonsoft.Json
case JTokenType.Object:
{
if (_currentScope.CurrentPropertyName == null)
throw new Exception("CurrentPropertyName has not been set on scope.");
throw new JsonReaderException("CurrentPropertyName has not been set on scope.");
IList<JsonSchemaModel> schemas = new List<JsonSchemaModel>();
@@ -291,7 +291,7 @@ namespace Newtonsoft.Json
set
{
if (TokenType != JsonToken.None)
throw new Exception("Cannot change schema while validating JSON.");
throw new InvalidOperationException("Cannot change schema while validating JSON.");
_schema = value;
_model = null;