-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
@@ -136,7 +136,7 @@ namespace Newtonsoft.Json.Utilities
}
else
{
throw new Exception("Can not create ListWrapper for type {0}.".FormatWith(CultureInfo.InvariantCulture, list.GetType()));
throw new ArgumentException("Can not create ListWrapper for type {0}.".FormatWith(CultureInfo.InvariantCulture, list.GetType()), "list");
}
}
@@ -167,7 +167,7 @@ namespace Newtonsoft.Json.Utilities
#endif
else
{
throw new Exception("Can not create DictionaryWrapper for type {0}.".FormatWith(CultureInfo.InvariantCulture, dictionary.GetType()));
throw new ArgumentException("Can not create DictionaryWrapper for type {0}.".FormatWith(CultureInfo.InvariantCulture, dictionary.GetType()), "dictionary");
}
}
@@ -237,7 +237,7 @@ namespace Newtonsoft.Json.Utilities
}
if (list == null)
throw new Exception("Cannot create and populate list type {0}.".FormatWith(CultureInfo.InvariantCulture, listType));
throw new InvalidOperationException("Cannot create and populate list type {0}.".FormatWith(CultureInfo.InvariantCulture, listType));
populateList(list, isReadOnlyOrFixedSize);