Skip to content

Commit c3fc579

Browse files
authored
Merge pull request #1284 from murgatroid99/grpc-js_server_stream_error
grpc-js: server calls: Don't try to send an error on stream error
2 parents 69482b2 + 8f668c8 commit c3fc579

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/grpc-js/src/server-call.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,11 @@ export class Http2ServerCallStream<
346346
super();
347347

348348
this.stream.once('error', (err: ServerErrorResponse) => {
349-
err.code = Status.INTERNAL;
350-
this.sendError(err);
349+
/* We need an error handler to avoid uncaught error event exceptions, but
350+
* there is nothing we can reasonably do here. Any error event should
351+
* have a corresponding close event, which handles emitting the cancelled
352+
* event. And the stream is now in a bad state, so we can't reasonably
353+
* expect to be able to send an error over it. */
351354
});
352355

353356
this.stream.once('close', () => {

0 commit comments

Comments
 (0)