Catching a Json Serialization Exception (JsonSerializationException)

Viewed 29

When deserializing a Json File into an object using the NewtonSoft.Json converter, I see a lot of exceptions written to the console's output. The error is the following one (repeated many times over):

Exception thrown: 'Newtonsoft.Json.JsonSerializationException' in Newtonsoft.Json.dll

Is there a way to catch these exception so that I can fix the issue?
Using a try/catch won't work as the exception is internal to the dll and the deserialization end up running successfully to completion. Meaning, I do get the expected deserialised object with all the correct values.
One might say that there is nothing to worry about, but I would really like to understand where all these non-fatal exceptions come from and if they need to be addressed.

Maybe there is a way to override "JsonSerializationException" somehow?
Any tips or code example would be very welcome.

0 Answers
Related