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

Node.js can't throw exceptions.

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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: