Skip to content

Commit

Permalink
grpc-js: Throw in watchConnectivityState if channel is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Mar 12, 2021
1 parent b374a83 commit 602fcd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/grpc-js/src/channel.ts
Expand Up @@ -480,6 +480,9 @@ export class ChannelImplementation implements Channel {
deadline: Date | number,
callback: (error?: Error) => void
): void {
if (this.connectivityState === ConnectivityState.SHUTDOWN) {
throw new Error('Channel has been shut down');
}
let timer = null;
if(deadline !== Infinity) {
const deadlineDate: Date =
Expand Down

0 comments on commit 602fcd2

Please sign in to comment.