Skip to content

Commit 18e7231

Browse files
committed
fix: a few more log integration fixups
1 parent b8092ae commit 18e7231

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/message-stream.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import {promisify} from '@google-cloud/promisify';
18-
import {ClientStub, grpc} from 'google-gax';
18+
import {ClientStub, GoogleError, grpc} from 'google-gax';
1919
import * as isStreamEnded from 'is-stream-ended';
2020
import {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);

0 commit comments

Comments
 (0)