Skip to content

Commit 2f4a12a

Browse files
committed
- Fix merge into beta remote_api_error
Add object Properties for remote API Call error, and response status commit 94d6f2b PS #909
1 parent e5357dc commit 2f4a12a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

dotnet/src/dotnetframework/GxClasses/Helpers/GXRestAPIClient.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ public void AddUploadFile(string FilePath, string name)
340340
public void RestExecute()
341341
{
342342
this.ErrorCode = 0;
343+
this.ErrorMessage = "";
344+
this.StatusCode = 0;
345+
this.StatusMessage = "";
343346
_queryString = String.Empty;
344347
if (_queryVars.Count > 0)
345348
{
@@ -384,16 +387,16 @@ public void RestExecute()
384387
serviceuri += "/" + this.Location.BaseUrl.TrimEnd('/').TrimStart('/') + "/" + this.Location.ResourceName;
385388
serviceuri += _queryString;
386389
httpClient.HttpClientExecute( this.HttpMethod, serviceuri);
390+
this.ErrorCode = httpClient.ErrCode;
391+
this.ErrorMessage = httpClient.ErrDescription;
392+
this.StatusCode = httpClient.StatusCode;
393+
this.StatusMessage = httpClient.ReasonLine;
387394
if (httpClient.StatusCode >= 300 || httpClient.ErrCode > 0)
388395
{
389-
this.ErrorCode = (httpClient.ErrCode == 0)? 1: httpClient.ErrCode;
390-
this.ErrorMessage = httpClient.ErrDescription;
391-
this.StatusCode = httpClient.StatusCode;
392396
_responseData = new Dictionary<string, object>();
393397
}
394398
else
395399
{
396-
this.StatusCode = httpClient.StatusCode;
397400
_responseData = GeneXus.Utils.RestAPIHelpers.ReadRestParameters(httpClient.ToString());
398401
}
399402
}

dotnet/src/dotnetframework/GxClasses/Helpers/GxObjectProperties.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public class GxObjectProperties
2121
public int ErrorCode { get => errorCode; set => errorCode = value; }
2222
public int StatusCode { get => statusCode; set => statusCode = value; }
2323
public string StatusMessage { get => statusMessage; set => statusMessage = value; }
24-
2524
public int Protocol { get => protocol; set => protocol = value; }
2625
}
2726

0 commit comments

Comments
 (0)