Skip to content

Commit b52cf2c

Browse files
committed
Add try catch around bridge version
1 parent cf04327 commit b52cf2c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/IRCBridge.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Auditorium } from "./models/Auditorium";
2020
import { InterestRoom } from "./models/InterestRoom";
2121
import config from "./config";
2222
import { makeLocalpart } from "./utils/aliases";
23+
import { LogService } from 'matrix-bot-sdk';
2324

2425
export interface IRCBridgeOpts {
2526
botNick: string;
@@ -87,9 +88,13 @@ export class IRCBridge {
8788
} else {
8889
this.botRoomId = data.roomId;
8990
}
90-
91-
// This should timeout if the connection is broken
92-
await this.executeCommand("bridgeversion");
91+
92+
try {
93+
// This should timeout if the connection is broken
94+
await this.executeCommand("bridgeversion");
95+
} catch (ex) {
96+
LogService.warn(`IRCBridge`, "Failed to get IRC bridge version, it may be unreachable.");
97+
}
9398

9499
this.ircClient = new irc.Client(this.config.serverName, this.config.botNick, {
95100
port: this.config.port,

0 commit comments

Comments
 (0)