Handle query.room errors

This commit is contained in:
Half-Shot 2020-02-23 18:50:51 +00:00
parent a27855a48f
commit 07653c71f2

View File

@ -83,8 +83,13 @@ export class GithubBridge {
this.tokenStore = new UserTokenStore(this.config.github.passFile || "./passkey.pem", this.as.botIntent);
await this.tokenStore.load();
this.as.on("query.room", (roomAlias, cb) => {
cb(this.onQueryRoom(roomAlias));
this.as.on("query.room", async (roomAlias, cb) => {
try {
cb(await this.onQueryRoom(roomAlias));
} catch (ex) {
log.error("Failed to create room:", ex);
cb(false);
}
});
this.as.on("room.event", async (roomId, event) => {