From 7c0ad0db39dec3fc155cbedc7d5ba7fd251424b8 Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Tue, 14 Jan 2025 11:20:17 -0600 Subject: [PATCH] Comments (DH-18086-2) --- packages/jsapi-nodejs/src/NodeHttp2gRPCTransport.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/jsapi-nodejs/src/NodeHttp2gRPCTransport.ts b/packages/jsapi-nodejs/src/NodeHttp2gRPCTransport.ts index a13c540a4..d322c6608 100644 --- a/packages/jsapi-nodejs/src/NodeHttp2gRPCTransport.ts +++ b/packages/jsapi-nodejs/src/NodeHttp2gRPCTransport.ts @@ -80,6 +80,12 @@ export class NodeHttp2gRPCTransport implements GrpcTransport { private request: http2.ClientHttp2Stream | null = null; + /** + * Create an http2 client stream that can send requests to the server and pass + * responses to callbacks defined on the transport options. + * @param headers Request headers + * @returns The created http2 client stream + */ createRequest = ( headers: Record | null ): http2.ClientHttp2Stream => { @@ -159,7 +165,7 @@ export class NodeHttp2gRPCTransport implements GrpcTransport { */ finishSend(): void { logger.debug('finishSend'); - assertNotNull(this.request, '_request'); + assertNotNull(this.request, 'request is required'); this.request.end(); } @@ -169,7 +175,7 @@ export class NodeHttp2gRPCTransport implements GrpcTransport { */ cancel(): void { logger.debug('cancel'); - assertNotNull(this.request, '_request'); + assertNotNull(this.request, 'request is required'); this.request.close(); }