If a non 2XX error code is received, then resultRequest.ResponseContent is deserialized by Newtonsoft.Json.
|
var wrapper = JsonConvert.DeserializeObject<ErrorsWrapper>(resultRequest.ResponseContent); |
However, the ResponseContent received is sometimes not JSON. One user received the following error; it's possible that the ResponseContent is html rather than a JSON string.
Error :Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
It may be helpful to handle this error more gracefully and provide the user with a better message.
If a non 2XX error code is received, then
resultRequest.ResponseContentis deserialized by Newtonsoft.Json.faunadb-csharp/FaunaDB.Client/Client/FaunaClient.cs
Line 183 in a5c58cf
However, the ResponseContent received is sometimes not JSON. One user received the following error; it's possible that the ResponseContent is html rather than a JSON string.
It may be helpful to handle this error more gracefully and provide the user with a better message.