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/16 15:37:21 UTC

[GitHub] houshengbo closed pull request #91: Fix invalid warning message

houshengbo closed pull request #91: Fix invalid warning message
URL: https://github.com/apache/incubator-openwhisk-client-go/pull/91
 
 
   

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 58a29b76..2c5f719e 100644
--- a/whisk/client.go
+++ b/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)
+
 	return true
 }
 


 

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