Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation about callback and returning proper error responses #8

Open
monis0395 opened this issue Sep 30, 2019 · 0 comments
Open

Comments

@monis0395
Copy link

Hi,

I was using FunctionScript in stdlib, I had a hard time finding about the callback function definition and how to return caught errors properly in case of sync and async functions.

Ultimately looking at the testcases and code in lib/gateway.js I was able to confirm

  • callback definition is callback(error, body, header)
  • in async function there is no way to return error, we just have to throw them, which would be caught execute to send a proper error response to client

So it would be a lot helpful if we add these details in documentation.

PS: Thanks for putting testcases!

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

No branches or pull requests

1 participant