Closed kriskowal closed 9 years ago
r @ShanniLi @Raynos @jcorbin
Please give this a spin to assess the usability. Example:
before❯ node index.js -p 127.0.0.1:21300 -t ~/larry/thrift/stooges.thrift larry Stooges::nyuck
'Got call response ok'
{ name: 'larry', language: 'python' }
after❯ node index.js -p 127.0.0.1:21300 -t ~/larry/thrift/stooges.thrift larry Stooges::nyuck | jq
{
"ok": true,
"head": {},
"body": {
"name": "larry",
"language": "python"
},
"headers": {
"as": "thrift"
}
}
❯ node index.js -p 127.0.0.1:21300 autobahn connections_v1 -3 '{"serviceName": "larry"}' | jq
{
"ok": true,
"head": null,
"body": {
"127.0.0.1:21300": {
"instances": {
"10.32.193.49:56903": {
"connected": {
"in": true,
"out": true
},
"identified": {
"in": true,
"out": true
},
"serviceNames": [
"larry"
]
}
}
},
"127.0.0.1:21301": {
"instances": {
"10.32.193.49:56903": {
"connected": {
"in": true,
"out": true
},
"identified": {
"in": true,
"out": true
},
"serviceNames": [
"larry"
]
}
}
}
},
"headers": {
"as": "json"
}
}
@kriskowal
Can you show an example of "error frame", "not ok response" and "ECONNREFUSED" with this new tcurl ?
@Raynos, stderr as follows, exit code 1.
{ [TchannelBadRequestError: Endpoint 'Meta::health' is not defined]
type: 'tchannel.bad-request',
message: 'Endpoint \'Meta::health\' is not defined',
isErrorFrame: true,
codeName: 'BadRequest',
errorCode: 6,
originalId: 2,
name: 'TchannelBadRequestError',
fullType: 'tchannel.bad-request' }
I believe from our offline discussion you would like this to be stdout. I think it would be good to surface the "errorCode" as the exit code, so 6.
{
"isErrorFrame": true,
"message": "Endpoint \'Meta::health\' is not defined",
"codeName": "BadRequest",
"errorCode": 6,
"originalId": 2,
"name": "TchannelBadRequestError",
"fullType": "tchannel.bad-request"
}
Feedback fed back. Please yay or nay.
:8ball: says :ship:
Would appreciate answering the question about assert.ifError v.s. if (err) { assert.end(err) }
Other than that, lgtm.
Yeah, thought I had. assert.ifError is non-fatal and does not stop the test, just as delegate.error is non-fatal and does not indicate that tcurl is finished. That is the sole purview of delegate.exit. Thanks for your feedback!
Make sense. Thanks! @kriskowal
These are a few initial steps toward untangling the control flow, complexity, and bad UX that has accumulated in TCurl.