You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/03 14:32:32 UTC

[GitHub] dubeejw closed pull request #52: Skip testing whether the HTTP body indicating a whisk failure result

dubeejw closed pull request #52: Skip testing whether the HTTP body indicating a whisk failure result
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/52
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/whisk/client.go b/whisk/client.go
index 8b978ae2..b32af63e 100644
--- a/whisk/client.go
+++ b/whisk/client.go
@@ -374,10 +374,13 @@ func (c *Client) Do(req *http.Request, v interface{}, ExitWithErrorOnTimeout boo
     // Handle 0. HTTP Success + Body indicating a whisk failure result
     //   NOTE: Need to ignore activation records send in response to 'wsk get activation NNN` as
     //         these will report the same original error giving the appearance that the command failed.
+    //         Need to ignore `wsk action invoke NNN --result` too, otherwise action whose result is sth likes
+    //         '{"response": {"key": "value"}}' will return an error to such command.
     if (IsHttpRespSuccess(resp) &&                                      // HTTP Status == 200
         data!=nil &&                                                    // HTTP response body exists
         v != nil &&
         !strings.Contains(reflect.TypeOf(v).String(), "Activation") &&  // Request is not `wsk activation get`
+        !(req.URL.Query().Get("result") == "true") &&                   // Request is not `wsk action invoke NNN --result`
         !IsResponseResultSuccess(data)) {                               // HTTP response body has Whisk error result
         Debug(DbgInfo, "Got successful HTTP; but activation response reports an error\n")
         return parseErrorResponse(resp, data, v)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services