This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 14b3a05  Fix invalid warning message (#91)
14b3a05 is described below

commit 14b3a05f60a0e2e572957cb51e38c50b9a0b03e9
Author: James Dubee <[email protected]>
AuthorDate: Fri Nov 16 10:37:18 2018 -0500

    Fix invalid warning message (#91)
---
 whisk/client.go | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/whisk/client.go b/whisk/client.go
index 6797651..a421a35 100644
--- a/whisk/client.go
+++ b/whisk/client.go
@@ -675,10 +675,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
 }
 

Reply via email to