JamesNK / Newtonsoft.Json

Json.NET is a popular high-performance JSON framework for .NET
https://www.newtonsoft.com/json
MIT License
10.73k stars 3.25k forks source link

Can you add potential thrown exception to method docs #2235

Open joro550 opened 4 years ago

joro550 commented 4 years ago

Looking at the docs for methods that can throw exceptions for Newtonsoft i.e. https://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_Linq_JObject_GetValue.htm, I don't get any information about the types of exceptions being thrown by this method or if they throw exceptions at all.

The two reasons I ask are

  1. I have just been caught out by SelectToken on JObject throwing an exception even though I didn't know that it could
  2. This would follow the microsoft convention for example Int32.Parse: https://docs.microsoft.com/en-us/dotnet/api/system.int32.parse?view=netframework-4.8 tell me what exception is thrown and under what circumstances.

I appreciate this could be a lot of effort!

bartelink commented 4 years ago

I appreciate this could be a lot of effort!

So, make a PR... I can't imagine there being objections (but it is a good idea to make people aware of your plans rather than ambushing them after the fact, as you've done)