Error handling in OpenWhisk actions
With a standard OpenWhisk action, we return a dictionary of the data and let OpenWhisk deal with converting it to JSON etc. OpenWhisk will also set the correct 200 status code. How do we handle an error though? It turns out that if there is a key called "error" in our returned dictionary, then all the other data is ignored and an error is sent back. To show this, consider this action: func main(args: [String:Any])… continue reading.