Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1267

Node.js can't throw exceptions.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      There is no way as far as I can tell for node.js servers to throw thrift exceptions.

      I have made a patch to allow it to throw exceptions. It lets the node.js server implementation give params directly to the result object, thereby being able to specify the exception. It doesn't affect normal (non exception) return data.

      Test case: https://gist.github.com/1151782
      Install thrift module "npm install thrift", generate thrift "thrift --gen js:node test.thrift" and run server then client.

      Attachments

        1. nodejs-exception.patch
          1 kB
          Hans Duedal
        2. thrift-1267-callback.patch
          2 kB
          Hans Duedal
        3. thrift-1267-callback-ns-fix.patch
          2 kB
          Hans Duedal
        4. package.json
          0.8 kB
          Henrique Mendonca
        5. server.js
          5 kB
          Henrique Mendonca
        6. client.js
          4 kB
          Henrique Mendonca
        7. Makefile
          1 kB
          Henrique Mendonca
        8. THRIFT-1267-ex-ns-fixes+tests.patch
          7 kB
          Henrique Mendonca

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            henrique Henrique Mendonca
            cypres Hans Duedal
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment