private void ProcessJsonErrors(string response)
{
string realErrorString = "";
try
{
if (response.Contains("errors"))
{
var jsonErrors = JsonConvert.DeserializeObject<JsonErrorsData>(response);
if (jsonErrors.Errors != null && jsonErrors.Errors.Length > 0)
{
realErrorString = jsonErrors.Errors[0].ToString();
}
}
}
catch
{
}
if (!string.IsNullOrWhiteSpace(realErrorString))
throw new Exception(realErrorString);
}