Skip to content

Conversation

@mdeuser
Copy link
Contributor

@mdeuser mdeuser commented Nov 26, 2019

Currently, application errors are not parsed since the application error format is dynamic. This PR treats the application error as generic JSON, inspecting the "error" field for its data type and handling the type appropriately.

Also, vendor.json is updated to include several missing packages

@mdeuser mdeuser requested review from dubee and pritidesai November 27, 2019 14:55
"revision": "d8f796af33cc11cb798c1aaeb27a4ebc5099927d",
"revisionTime": "2018-08-30T19:11:22Z"
},
{
Copy link
Contributor

@mrutkows mrutkows Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we bring on all these libs? lots of ones related to color console output? We should not be using these in the go-client (perhaps in the CLI). Did we accidentally pick up all dependencies used by the combined CLI (plugin) perhaps via govendor which does not discriminate actual libs. used by the code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to this PR (which does not seem to use any new external libs.) we only had vendor.json with these libs:

  • github.com/davecgh/go-spew/spew
  • github.com/pmezard/go-difflib/difflib
  • github.com/stretchr/testify/assert

return resp, whiskErr
}

func getApplicationErrorMessage(errResp interface{}) string {
Copy link
Contributor

@mrutkows mrutkows Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what conditions caused a new format error to be generated? is there an example that can be cited that would be encountered (and added to the comment in code?). Would love to know where we have seen this error map format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrutkows this fix is primarily for usage by the trigger create/delete code. this cli code invokes the action internally, and needs the error response details. without this pr, the error details are missing. here's the cli routine that invokes the client-go code. https://github.com/apache/openwhisk-cli/blob/368da5bf3d34b4a9b64204a0876618d79e014146/commands/trigger.go#L80

without this pr, you can see that the err returned from the Client.Triggers.Insert does not have the failure details when you create a trigger using your own "bad" feed action.

Copy link
Contributor

@mrutkows mrutkows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a commit to return vendor.json to original contents

@mrutkows mrutkows merged commit d272b2b into apache:master Dec 11, 2019
@mdeuser
Copy link
Contributor Author

mdeuser commented Dec 14, 2019

@mrutkows - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants