diff --git a/src/channelsyncroniser.ts b/src/channelsyncroniser.ts index e2aa65ec7dc6a7b8323e186c268fd9ea4773a821..9f24d6f1d56fad4c5990ef3c7b1fcf53e417af83 100644 --- a/src/channelsyncroniser.ts +++ b/src/channelsyncroniser.ts @@ -289,7 +289,6 @@ export class ChannelSyncroniser { const intent = await this.bridge.getIntent(); const options = overrideOptions || this.config.channel.deleteOptions; const plumbed = entry.remote!.get("plumbed"); - // tslint:disable-next-line: no-any await this.roomStore.upsertEntry(entry); if (options.ghostsLeave) { @@ -364,7 +363,6 @@ export class ChannelSyncroniser { } } - // Remove entry await this.roomStore.removeEntriesByMatrixRoomId(roomId); } } diff --git a/src/provisioner.ts b/src/provisioner.ts index 4f92ca7ab2c540d9a9777683a72d4ac559efd83e..46b7624f102c5652f444b13e7950882820855e7c 100644 --- a/src/provisioner.ts +++ b/src/provisioner.ts @@ -59,9 +59,11 @@ export class Provisioner { roomsToUnbridge = roomsRes.map((entry) => entry.matrix!.roomId); } await Promise.all(roomsToUnbridge.map( async (roomId) => { - return this.channelSync.OnUnbridge(channel, roomId).catch((err) => { - log.error(`Failed to cleanly unbridge ${channel.id} ${channel.guild} from ${roomId}`); - }); + try { + await this.channelSync.OnUnbridge(channel, roomId); + } catch (ex) { + log.error(`Failed to cleanly unbridge ${channel.id} ${channel.guild} from ${roomId}`, ex); + } })); await this.roomStore.removeEntriesByRemoteRoomId(remoteRoom.getId()); } diff --git a/src/util.ts b/src/util.ts index 87555ca136be00ab65faf6ec5bccbdaed4647c7f..68fe972037a2f9a643348935febc2c230ea15abc 100644 --- a/src/util.ts +++ b/src/util.ts @@ -29,13 +29,13 @@ const HTTP_OK = 200; import { Log } from "./log"; const log = new Log("Util"); -type PERMISSIONTYPES = any; // tslint:disable-line no-any +type PERMISSIONTYPES = any | any[]; // tslint:disable-line no-any export interface ICommandAction { description?: string; help?: string; params: string[]; - permission?: PERMISSIONTYPES | PERMISSIONTYPES[]; + permission?: PERMISSIONTYPES; run(params: any): Promise<any>; // tslint:disable-line no-any } @@ -336,9 +336,9 @@ export class Util { const retStr = await action.run(params); return retStr; } catch (e) { - return `**ERROR:** ${e.message}`; log.error("Error processing command"); log.error(e); + return `**ERROR:** ${e.message}`; } }