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/11/19 21:04:52 UTC

[GitHub] mdeuser commented on a change in pull request #105: fixing logic on test for result success

mdeuser commented on a change in pull request #105: fixing logic on test for result success
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/105#discussion_r234780981
 
 

 ##########
 File path: whisk/client.go
 ##########
 @@ -676,12 +676,10 @@ func IsResponseResultSuccess(data []byte) bool {
 	errResp := new(WhiskErrorResponse)
 	err := json.Unmarshal(data, &errResp)
 
-	if err != nil {
-		Debug(DbgWarn, "IsResponseResultSuccess: failed to parse response result: %v\n", err)
-		return false
-	}
-
 	if errResp.Response != nil {
+		if err != nil && !errResp.Response.Success { //failed to parse WhiskErrorResponse AND was not success
 
 Review comment:
   @tysonnorris - i'm trying to think of a scenario in which errResponse.Response != nil and err != nil..  that is, if the bytes can't be parsed (i.e. not valid json) `err` will be set to some error (!= nil) and `errResp` will be left alone (pointer to struct having the `Response` field pointer set to nil).  but i'm guessing you had some response that drove this logic, so would you mind pasting that response string/bytes here to set me straight :smile:  

----------------------------------------------------------------
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