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 2021/01/05 20:36:32 UTC
[GitHub] [openwhisk-client-go] ShubhamGupta9582 opened a new pull request #142: update status code if action returns error
ShubhamGupta9582 opened a new pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142
This is draft PR. raising for review.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] rabbah commented on pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
rabbah commented on pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142#issuecomment-755340337
Thanks @ShubhamGupta9582 for the contribution.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] ShubhamGupta9582 commented on a change in pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
ShubhamGupta9582 commented on a change in pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142#discussion_r552186790
##########
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:
done
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] ShubhamGupta9582 commented on pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
ShubhamGupta9582 commented on pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142#issuecomment-755110541
@rabbah I ran `gofmt` locally and pushed changes
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] rabbah commented on pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
rabbah commented on pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142#issuecomment-754981539
@ShubhamGupta9582 this failed in CI:
```
The command "test -z "$(gofmt -s -l $(echo $GO_FILES))"" failed and exited with 1 during .
```
I think there's a formatting error. You can run `gofmt` locally.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] ShubhamGupta9582 edited a comment on pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
ShubhamGupta9582 edited a comment on pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142#issuecomment-755110541
@rabbah I ran `gofmt` locally and pushed changes.
EDIT: `gofmt` command formatted one line but it was not giving any error.
I also ran below two commands on my local and it was working fine
```
GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/)
test -z "$(gofmt -s -l $(echo $GO_FILES))"
```
How can i produce `The command "test -z "$(gofmt -s -l $(echo $GO_FILES))"" failed and exited with 1 during .` error on my local ?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] rabbah commented on a change in pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
[GitHub] [openwhisk-client-go] rabbah merged pull request #142: update status code if action returns error
Posted by GitBox <gi...@apache.org>.
rabbah merged pull request #142:
URL: https://github.com/apache/openwhisk-client-go/pull/142
----------------------------------------------------------------
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:
users@infra.apache.org