Skip to content

Documentation about callback and returning proper error responses #8

Description

@monis0395

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions