-
Notifications
You must be signed in to change notification settings - Fork 43
update status code if action returns error #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rabbah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
whisk/activation.go
Outdated
| return nil, resp, err | ||
| } | ||
|
|
||
| if a.Success == false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could remove this predicate here and instead assign code = 0 for the default case in the switch below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
whisk/activation.go
Outdated
| return a, resp, nil | ||
| } | ||
|
|
||
| func GetStatusCodeForErrorMessage(msg string) (int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
@ShubhamGupta9582 this failed in CI: I think there's a formatting error. You can run |
|
@rabbah I ran EDIT: How can i produce |
|
Thanks @ShubhamGupta9582 for the contribution. |
This PR is a fix for the issue which i raised for the activation's
statusCode.For more details about the issue, please click here
I have updated
statusCodeon the basis ofstatusSo that we can get correctstatusCodeaccording tostatus.