File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1515 */
1616
1717import { promisify } from '@google-cloud/promisify' ;
18- import { ClientStub , grpc } from 'google-gax' ;
18+ import { ClientStub , GoogleError , grpc } from 'google-gax' ;
1919import * as isStreamEnded from 'is-stream-ended' ;
2020import { PassThrough } from 'stream' ;
2121
@@ -452,7 +452,12 @@ export class MessageStream extends PassThrough {
452452 const tracker = this . _streams [ index ] ;
453453 const receivedStatus =
454454 ! tracker . stream || ( tracker . stream && ! tracker . receivedStatus ) ;
455- logs . subscriberStreams . error ( 'error on stream %i: %o' , index , err ) ;
455+
456+ // For the user-cancelled errors, we don't need to show those, we're handling
457+ // notifying of us closing the stream elsewhere.
458+ if ( ( err as GoogleError ) . code !== 1 ) {
459+ logs . subscriberStreams . error ( 'error on stream %i: %o' , index , err ) ;
460+ }
456461
457462 if ( typeof code !== 'number' || ! receivedStatus ) {
458463 this . emit ( 'error' , err ) ;
You can’t perform that action at this time.
0 commit comments