Closed
Description
Environment details:
- local deployment (standalone openwhisk)
Steps to reproduce the issue:
- create a web action using this function:
> cat t.js
const main = () => ({
"body": {
"message": "hello"
},
"statusCode": 442
})
- invoke the web action
> wsk action update t t.js --web true
> curl -X POST `wsk action get t --url`
{
"code": "b86c3c15bed0763357caa327bd2f25e4",
"error": "Response is not valid 'message/http'."
}
Expecting the API to work (return the message
) but it does not.
Change the statusCode
to 400 and the API works as expected.
The relevant logic is here
This is an error in the controller for status code 442 but it is swallowed. Amending the Try
logic to show the exceptions produces:
exception in resultAsHttp: java.lang.RuntimeException:
Non-standard status codes cannot be created by implicit conversion.
Use `StatusCodes.custom` instead.
For reference, this is the cited message:
https://github.com/akka/akka-http/blob/5f8fb8c29285dcef16d74704394a7f6acf4f544e/akka-http-core/src/main/scala/akka/http/scaladsl/model/StatusCode.scala#L87