[ 
https://issues.apache.org/jira/browse/THRIFT-1267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henrique Mendonca updated THRIFT-1267:
--------------------------------------

    Attachment: THRIFT-1267-ex-ns-fixes+tests.patch
                Makefile
                client.js
                server.js
                package.json

OK thanks for the feedback Roger,
a line too much in the compiler and the client were outdated (see comments 
above). The example should work again now.

I'm also adding the 4 files I have under test/nodejs, including a package.json 
but it wasn't tested with npm.

The client.js is just a start, it only test a 12 of the services and it would 
look a lot nicer with qunit, but it'd add a dependency...

>From these few unit tests we can see already that a lot of stuff is not 
>working as it should, e.g. int64 (negative and large values), maps and 
>services with exceptions only work partially (app. exceptions come as 'null' 
>and nothing comes back on success)

Anyway, I think that's an improvement already.






                
> Node.js can't throw exceptions. 
> --------------------------------
>
>                 Key: THRIFT-1267
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1267
>             Project: Thrift
>          Issue Type: Improvement
>          Components: JavaScript - Compiler, Node.js - Compiler
>    Affects Versions: 0.7
>            Reporter: Hans Duedal
>              Labels: compiler, javascript, node, nodejs
>             Fix For: 0.9
>
>         Attachments: Makefile, THRIFT-1267-ex-ns-fixes+tests.patch, 
> THRIFT-1267-ns-fixes.patch, client.js, nodejs-exception.patch, package.json, 
> server.js, thrift-1267-callback-ns-fix.patch, thrift-1267-callback.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to