You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When invoking a function remotely via serverless invoke, it returns ONLY the response, whether that be an error or a success message.
When invoking a local function via invoke local, it returns things differently:
On success, invoke local returns the response, but right before that it prints:
Serverless: successfully invoked your function
This should be removed. The first reason is that it's obvious whether it has succeeded or failed. The second reason is that there are a lot of plugins that want to parse the response from the invoke command, but if we put Serverless statements in that response, it makes it really hard to parse, since the CLI standard output has to be parsed and the log statement is mixed in with the that.
On error, it returns an error that looks like something went wrong with the Serverless Framework, not the user's code:
$ sls invoke local -f connect
Syntax Error -------------------------------------------
Unexpected token u in JSON at position 0
For debugging logs, run again after setting SLS_DEBUG env var.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Please report this error. We think it might be a bug.
Your Environment Information -----------------------------
OS: darwin
Node Version: 6.6.0
Serverless Version: 1.1.0
This isn't the right experience. We should catch the error and return a specific looking error that explains the code is wrong, the line, stacktrace, etc...
The text was updated successfully, but these errors were encountered:
This is a proposal
Description
When invoking a function remotely via
serverless invoke
, it returns ONLY the response, whether that be an error or a success message.When invoking a local function via
invoke local
, it returns things differently:invoke local
returns the response, but right before that it prints:This should be removed. The first reason is that it's obvious whether it has succeeded or failed. The second reason is that there are a lot of plugins that want to parse the response from the
invoke
command, but if we put Serverless statements in that response, it makes it really hard to parse, since the CLI standard output has to be parsed and the log statement is mixed in with the that.This isn't the right experience. We should catch the error and return a specific looking error that explains the code is wrong, the line, stacktrace, etc...
The text was updated successfully, but these errors were encountered: