Skip to content

Commit

Permalink
Don't log Cancelled warning when strem is closed (#3450)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian authored Jul 22, 2020
1 parent beed830 commit 75b6b31
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/firestore/src/platform/node/grpc_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,17 @@ export class GrpcConnection implements Connection {
});

grpcStream.on('error', (grpcError: ServiceError) => {
logWarn(
LOG_TAG,
'GRPC stream error. Code:',
grpcError.code,
'Message:',
grpcError.message
);
const code = mapCodeFromRpcCode(grpcError.code);
close(new FirestoreError(code, grpcError.message));
if (!closed) {
logWarn(
LOG_TAG,
'GRPC stream error. Code:',
grpcError.code,
'Message:',
grpcError.message
);
const code = mapCodeFromRpcCode(grpcError.code);
close(new FirestoreError(code, grpcError.message));
}
});

logDebug(LOG_TAG, 'Opening GRPC stream');
Expand Down

0 comments on commit 75b6b31

Please sign in to comment.