private void CheckResponseAndThrow(string response) { if (response.Length > 13 && response.Substring(0, 13).Contains("\"error\"")) { PError err = Newtonsoft.Json.JsonConvert.DeserializeObject <PError>(response); //lastRequestMsg = err.error; //lastRequestStatus = false; throw new MarketAPIException("Market API Error:" + err.error); } }
private void CheckResponseAndThrow(string response) { if (response.Length > 13 && response.Substring(0, 13).Contains("\"error\"")) { PError err = null; try { err = Newtonsoft.Json.JsonConvert.DeserializeObject <PError>(response); }catch (Exception ex) { throw new MarketAPIException("Unknown API Erroror:" + response); } throw new MarketAPIException("Market API Error:" + err.error); } }