Skip to content

Commit

Permalink
chore: fix for Cancelled call
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Zorkaltsev committed Sep 25, 2024
1 parent ac9d991 commit 3675c9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/table/table-session-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import EventEmitter from "events";
import DiscoveryService from "../discovery/discovery-service";
import {Events, SESSION_KEEPALIVE_PERIOD} from "../constants";
import _ from "lodash";
import {BadSession, SessionBusy, SessionPoolEmpty} from "../errors";
import {BadSession, Cancelled, SessionBusy, SessionPoolEmpty} from "../errors";

import {TableSession} from "./table-session";
import {IClientSettings} from "./table-client";
Expand Down Expand Up @@ -221,7 +221,7 @@ export class TableSessionPool extends EventEmitter {
session.release();
return result;
} catch (error) {
if (error instanceof BadSession || error instanceof SessionBusy) {
if (error instanceof BadSession || error instanceof SessionBusy || error instanceof Cancelled) {
this.logger.debug('Encountered bad or busy session, re-creating the session');
session.emit(SessionEvent.SESSION_BROKEN);
session = await this.createSession();
Expand Down

0 comments on commit 3675c9e

Please sign in to comment.