mirror of https://github.com/grpc/grpc-node.git
grpc-js: Handle error when starting call on subchannel
This commit is contained in:
parent
7a44ef8c01
commit
812db0d198
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@grpc/grpc-js",
|
"name": "@grpc/grpc-js",
|
||||||
"version": "0.6.12",
|
"version": "0.6.13",
|
||||||
"description": "gRPC Library for Node - pure JS implementation",
|
"description": "gRPC Library for Node - pure JS implementation",
|
||||||
"homepage": "https://grpc.io/",
|
"homepage": "https://grpc.io/",
|
||||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||||
|
|
|
@ -216,10 +216,17 @@ export class ChannelImplementation implements Channel {
|
||||||
pickResult.subchannel!.getConnectivityState() ===
|
pickResult.subchannel!.getConnectivityState() ===
|
||||||
ConnectivityState.READY
|
ConnectivityState.READY
|
||||||
) {
|
) {
|
||||||
pickResult.subchannel!.startCallStream(
|
try {
|
||||||
finalMetadata,
|
pickResult.subchannel!.startCallStream(
|
||||||
callStream
|
finalMetadata,
|
||||||
);
|
callStream
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
callStream.cancelWithStatus(
|
||||||
|
Status.UNAVAILABLE,
|
||||||
|
'Failed to start call on picked subchannel'
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
callStream.cancelWithStatus(
|
callStream.cancelWithStatus(
|
||||||
Status.UNAVAILABLE,
|
Status.UNAVAILABLE,
|
||||||
|
|
Loading…
Reference in New Issue