コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 public GaiaClientException(GaiaError error) : base(error.message)
 {
     this.GaiaError = error;
 }