internal static void HandleResponse(IRestResponse <object> resp) { if (resp.StatusCode != HttpStatusCode.OK) { if (resp.ErrorException != null) { throw resp.ErrorException; } if (!string.IsNullOrEmpty(resp.Content)) { throw new GaiaClientException(GaiaError.FromDictionary((Dictionary <string, object>)resp.Data)); } else { throw new Exception("Request failed. Status " + resp.StatusCode); } } }
public GaiaClientException(GaiaError error) : base(error.message) { this.GaiaError = error; }