LINQ to JSON throws System.Exception

Jan 7, 2011 at 11:11 PM

Please consider throwing a better exception than System.Exception in LINQ to JSON, converters, and anywhere else there's a possibility that unexpected data could cause the exception. I would love to use LINQ to JSON, but I don't dare because there is no way for me to catch exceptions caused by unexpected JSON data (but not catch other critical exceptions). Similarly, SelectToken should throw a "catchable" exception when errorWhenNoMatch is set to true.

A converter example is IsoDateTimeConverter, which throws System.Exception if the DateTime property is not a string.

Would you be interested in a patch if I made changes?

P.S. Congratulations on your latest release!