Hi Tommi,

thanks for the quick answer !

I will wait for the repository upgrade. In the meantime a 
small workaround on client side do the job for me ... it's 
ugly but solves the problem for a tiny project.
("if error is String, then error={code: guessCode(..), 
message: error}")

Maybe this helps fixing:

- - - - - - - - - - - - - - - - - - - - - - - - - - -
sebastian@castle $ telnet localhost 7004
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

{ "jsonrpc": "2.0", "method": "add", "params": [9], "id":4}
{"jsonrpc":"2.0","error":{"code":0,"message":"argument 
expected"}}
-->instead of-32602 (Invalid params)


{ "jsonrpc": "2.0", "method": "add", "params": [8,9, 10], 
"id":4}
{"jsonrpc":"2.0","error":{"code":0,"message":"too many 
arguments"}}
-->instead of-32602 (Invalid params)


{ "jsonrpc": "2.0", "params": [8,9, 10], "id":4}
{"jsonrpc":"2.0","error":"Missing info for 'method'"}
-->instead of-32600 (Invalid Request)


{ "jsonrpc": "2.0", "method": "testfunc", "params": [8,9], 
"id":4}             -
{"jsonrpc":"2.0","error":"no such procedure \"testfunc\""}
->instead of-32601 (Method not found)


{ "jsonrpc": "2.0",method:"add", "id":4}
Connection closed by foreign host.
-->instead of-32700 (Parse error) not close connection

sebastian@castle $
- - - - - - - - - - - - - - - - - - - - - - - - - - -


Thanks a lot,
Sebastian




On 21.03.2014 13:07, Tommi Mäkitalo wrote:
> Hi Sebastian,
>
> I'd say it is a bug. I will fix that.
>
> Unfortunately it may not come soon into your Linux Mint. If it is a
> urgent problem there are some options: compile your own cxxtools from
> git, patch the deb-src-package of Mint and recreate a fixed package or
> we create a fixed cxxtools version (2.2.2), which may take just some
> months until you get it into your Mint.
>
>
> Tommi
>
> Am 21.03.2014 11:50, schrieb Sebastian Schoene:
>> Hi list,
>>
>> according to
>> http://www.jsonrpc.org/specification#error_object in
>> JSON-RPC Version 2, the error member of a response have to
>> contain the members 'code' and 'message'.
>>
>> For me, it looks like cxxtools::json::RpcServer doesn't act
>> this way:
>> - - - - - - - - - - - - - - - - - - - - - - - -
>> sebastian@castle $ telnet localhost 7004
>> Trying 127.0.0.1...
>> Connected to localhost.
>> Escape character is '^]'.
>>
>> { "jsonrpc": "2.0", "method": "add", "params": [8,9], "id":4}
>> {"jsonrpc":"2.0","id":4,"result":17}
>>
>> { "jsonrpc": "2.0", "method": "foobar", "params": [8,9], "id":4}
>> {"jsonrpc":"2.0","error":"no such procedure \"foobar\""}
>>
>> NonsenseInputFromClient
>> {"jsonrpc":"2.0","error":"Missing info for 'method'"}
>> - - - - - - - - - - - - - - - - - - - - - - - -
>>
>> Is it possible to configure cxxtools::json::RpcServer to
>> answer as excepted by the spec?
>>
>> I am using cxxtools from Linux Mint 16 Petra repository; so
>> its Debian package 'libcxxtools9' Version: 2.2-1.
>>
>>
>> Thanks,
>> Sebastian
>>
>>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general


-- 
Sebastian Schöne
Radiation Physics
Helmholtz-Zentrum Dresden-Rossendorf
Phone: +49 351 260 2979
[email protected]
https://www.hzdr.de

Vorstand: Prof. Dr. Dr. h. c. Roland Sauerbrey,
     Prof. Dr. Dr. h. c. Peter Joehnk
Vereinsregister: VR 1693 beim Amtsgericht Dresden


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to