rabbah commented on a change in pull request #142:
URL:
https://github.com/apache/openwhisk-client-go/pull/142#discussion_r552181469
##########
File path: whisk/activation.go
##########
@@ -216,9 +216,28 @@ func (s *ActivationService) Get(activationID string)
(*Activation, *http.Respons
return nil, resp, err
}
+ if a.Success == false {
Review comment:
you could remove this predicate here and instead assign code = 0 for the
default case in the switch below.
##########
File path: whisk/activation.go
##########
@@ -216,9 +216,28 @@ func (s *ActivationService) Get(activationID string)
(*Activation, *http.Respons
return nil, resp, err
}
+ if a.Success == false {
+ a.StatusCode = GetStatusCodeForErrorMessage(a.Status)
+ }
+
return a, resp, nil
}
+func GetStatusCodeForErrorMessage(msg string) (int) {
Review comment:
I suppose it's ok to have this function be public.
You can unit test just this function.
Note that to incorporate this fix into the `wsk` CLI, we'll need to bump the
godep
https://github.com/apache/openwhisk-cli/blob/678deee9510abac72b84c7f3ad98a0f58b97443e/Godeps/Godeps.json#L9
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]