apache / openwhisk-client-go

Go client library for the Apache OpenWhisk platform
https://openwhisk.apache.org/
Apache License 2.0
35 stars 44 forks source link

Add omit tag to ErrorResponse.Response field #121

Closed masnnuller closed 3 years ago

masnnuller commented 5 years ago

In the following code, resp is overwritten by activation.response field when called d.Decode(&errorResponse). So resp.StatusCode is changed to activation's status code, not HTTP response status code. This causes parseApplicationError never calls when parsing action developer error activation.

https://github.com/apache/incubator-openwhisk-client-go/blob/4286a8212a74c40d8950ee76681a67e12c9bf1a0/whisk/client.go#L557-L569

This PR changes to ignore ErrorResponse.Response field on parsing.

rabbah commented 5 years ago

Thanks @masnnuller for the explanation. Is there a test case we can add? I requested a review for @dubee who understands this code better than me.