/// <summary> /// /// </summary> /// <param name="data"></param> /// <returns></returns> protected override T DeserialiseData(string data) { try { // is this an error response? HuobiError errorMsg = JsonConvert.DeserializeObject <HuobiError>(data); // call the error handler if (errorMsg == null || errorMsg.code == 0) { throw new JsonSerializationException(); } throw new HuobiException(errorMsg); } catch (JsonSerializationException) { // couldn't deserialise the error, probably ok to proceed! return(base.DeserialiseData(data)); } }
public HuobiException(HuobiError error) : base() { m_error = error; }