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/05/23 21:04:31 UTC

[GitHub] mdeuser commented on a change in pull request #91: Fix invalid warning message

mdeuser commented on a change in pull request #91: Fix invalid warning message
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/91#discussion_r190398547
 
 

 ##########
 File path: whisk/client.go
 ##########
 @@ -652,10 +652,16 @@ func IsHttpRespSuccess(r *http.Response) bool {
 func IsResponseResultSuccess(data []byte) bool {
 	errResp := new(WhiskErrorResponse)
 	err := json.Unmarshal(data, &errResp)
-	if err == nil && errResp.Response != nil {
+
+	if err != nil {
+		Debug(DbgWarn, "IsResponseResultSuccess: failed to parse response result: %v\n", err)
+		return false
+	}
+
+	if errResp.Response != nil {
 		return errResp.Response.Success
 	}
-	Debug(DbgWarn, "IsResponseResultSuccess: failed to parse response result: %v\n", err)
+
 
 Review comment:
   
   let's see...   the affected method is only looking for a whisk response (i.e. correct unmarshalled json with a "result" object).. the warning message is provided when that condition is not met.   so maybe at this spot the message should be 
   ```Debug(DbgWarn, "IsResponseResultSuccess: http response did not contain a 'response' field; assuming successful response\n")```  ???

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