Skip to content
Snippets Groups Projects
Commit d80ab328 authored by James Dubee's avatar James Dubee Committed by dubeejw
Browse files

Go CLI Produces an Invalid Response When Whisk.Error() is Invoked

- Provide proper message when whisk.error() is invoked
- Add tests to ensure a whisk.error() response is received
- Return an exit code when an whisk.error() occurs without displaying an error
parent 7494a4d9
No related branches found
No related tags found
No related merge requests found
......@@ -375,6 +375,21 @@ class WskBasicTests
}
}
/**
* Tests creating an nodejs action that throws a whisk.error() response. The error message thrown by the
* whisk.error() should be returned.
*/
it should "create and invoke a blocking action resulting in a whisk.error response" in withAssetCleaner(wskprops) {
(wp, assetHelper) =>
val name = "whiskError"
assetHelper.withCleaner(wsk.action, name) {
(action, _) => action.create(name, Some(TestUtils.getTestActionFilename("applicationError1.js")))
}
wsk.action.invoke(name, blocking = true, expectedExitCode = 246)
.stderr should include regex (""""error": "This error thrown on purpose by the action."""")
}
it should "invoke a blocking action and get only the result" in withAssetCleaner(wskprops) {
(wp, assetHelper) =>
val name = "basicInvoke"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment