コード例 #1
0
 private void HandleResult(TableResult result)
 {
     if (result == null || result.Equals(null))
     {
         throw new RTableResourceNotFoundException("The resource could not be found or time out.");
     }
     if (result.HttpStatusCode == (int)HttpStatusCode.NoContent)
     {
         return;
     }
     else if (result.HttpStatusCode == (int)HttpStatusCode.ServiceUnavailable)
     {
         throw new RTableRetriableException("The operation should be retried.");
     }
     else if (result.HttpStatusCode == (int)HttpStatusCode.Conflict ||
              result.HttpStatusCode == (int)HttpStatusCode.PreconditionFailed)
     {
         throw new RTableConflictException("A conflict occurred.");
     }
     else if (result.Result == null || result.HttpStatusCode == (int)HttpStatusCode.NotFound)
     {
         throw new RTableResourceNotFoundException(
                   string.Format("http not found error, http status code: {0}, result {1}",
                                 result.HttpStatusCode, result.Result));
     }
 }