Open benfleis opened 9 years ago
@benfleis an empty string is invalid json.
The json arg scheme for tchannel requires json in arg2 and arg3.
You should send '{}' or 'null'
Yes, but tchannel can give a lot better of an error.
Agreed on error handling for such a situation. Perhaps I misunderstood -- is the tchannel/tcurl contract such that all data must be JSON? i.e., can you never send an Ok with no data?
@benfleis For the interim, TCurl accepts JSON for arg2 and arg3 for JSON and Thrift argschemes, or raw strings for the raw argscheme. It could be taught to use {} Thrift by default (or null if we adjust Thriftifty/ThriftRW to accept null in place of an object with all optional properties). I also have this crazy idea of finishing Argunauts to make it a little more natural to express JSON as command line arguments.
@jwolski agreed. We need to pass a logger into tcurl.
@benfleis if you want to do raw encoding then we have a --raw flag.
If you want an easier way to do json then you can import tchannel/as/json and it will do the correct thing for you.
I concur with @jwolski. This issue remains open until we provide a better error.
My client was temporarily hard coded to
resp.sendNotOk()
.When looking at said
as/json.js
code, I don't see why it would be null. I will try a little more debugging, but perhaps somebody over there has more insight into this. (I am also unsure whether it's fundamentally a tchannel problem, or a tcurl problem.)