Skip to content

Commit 72b2747

Browse files
Half-Shotreivilibre
authored andcommitted
Add try catch around bridge version
1 parent 450630d commit 72b2747

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/IRCBridge.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import {LogService, MatrixClient, MatrixEvent} from "matrix-bot-sdk";
17+
import { LogService, MatrixClient, MatrixEvent } from "matrix-bot-sdk";
1818
import * as irc from "irc-upd";
1919
import { Auditorium } from "./models/Auditorium";
2020
import { InterestRoom } from "./models/InterestRoom";
@@ -93,9 +93,13 @@ export class IRCBridge {
9393
} else {
9494
this.botRoomId = data.roomId;
9595
}
96-
97-
// This should timeout if the connection is broken
98-
await this.executeCommand("bridgeversion");
96+
97+
try {
98+
// This should timeout if the connection is broken
99+
await this.executeCommand("bridgeversion");
100+
} catch (ex) {
101+
LogService.warn(`IRCBridge`, "Failed to get IRC bridge version, it may be unreachable.");
102+
}
99103

100104
this.ircClient = new irc.Client(this.config.serverName, this.config.botNick, {
101105
port: this.config.port,

0 commit comments

Comments
 (0)