Skip to content

Commit

Permalink
Merge pull request #1714 from murgatroid99/grpc-js_watchConnectivityS…
Browse files Browse the repository at this point in the history
…tate_closed

grpc-js: Throw in watchConnectivityState if channel is closed
  • Loading branch information
murgatroid99 committed Mar 12, 2021
2 parents b374a83 + 602fcd2 commit f7802ae
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 f7802ae

Please sign in to comment.