Handle ResponseContent is not JSON
ptpaterson opened this issue · comments
Paul Paterson commented
If a non 2XX error code is received, then resultRequest.ResponseContent
is deserialized by Newtonsoft.Json.
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.